summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-03-30 10:21:58 +0100
committerLioncash <mathew1800@gmail.com>2019-03-30 10:28:43 +0100
commitcb805f45aeedb78fa681cd32a33a95374d99a1af (patch)
tree5877fa72325a6c0abae70a97ad7a5099e33420f7
parentMerge pull request #2266 from FernandoS27/arbitration (diff)
downloadyuzu-cb805f45aeedb78fa681cd32a33a95374d99a1af.tar
yuzu-cb805f45aeedb78fa681cd32a33a95374d99a1af.tar.gz
yuzu-cb805f45aeedb78fa681cd32a33a95374d99a1af.tar.bz2
yuzu-cb805f45aeedb78fa681cd32a33a95374d99a1af.tar.lz
yuzu-cb805f45aeedb78fa681cd32a33a95374d99a1af.tar.xz
yuzu-cb805f45aeedb78fa681cd32a33a95374d99a1af.tar.zst
yuzu-cb805f45aeedb78fa681cd32a33a95374d99a1af.zip
-rw-r--r--src/core/hle/kernel/scheduler.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp
index 6d0f13ecf..c02e54aa1 100644
--- a/src/core/hle/kernel/scheduler.cpp
+++ b/src/core/hle/kernel/scheduler.cpp
@@ -29,7 +29,7 @@ Scheduler::~Scheduler() {
}
bool Scheduler::HaveReadyThreads() const {
- std::lock_guard<std::mutex> lock(scheduler_mutex);
+ std::lock_guard lock{scheduler_mutex};
return !ready_queue.empty();
}
@@ -132,7 +132,7 @@ void Scheduler::UpdateLastContextSwitchTime(Thread* thread, Process* process) {
}
void Scheduler::Reschedule() {
- std::lock_guard<std::mutex> lock(scheduler_mutex);
+ std::lock_guard lock{scheduler_mutex};
Thread* cur = GetCurrentThread();
Thread* next = PopNextReadyThread();
@@ -149,34 +149,34 @@ void Scheduler::Reschedule() {
}
void Scheduler::AddThread(SharedPtr<Thread> thread, u32 priority) {
- std::lock_guard<std::mutex> lock(scheduler_mutex);
+ std::lock_guard lock{scheduler_mutex};
thread_list.push_back(std::move(thread));
}
void Scheduler::RemoveThread(Thread* thread) {
- std::lock_guard<std::mutex> lock(scheduler_mutex);
+ std::lock_guard lock{scheduler_mutex};
thread_list.erase(std::remove(thread_list.begin(), thread_list.end(), thread),
thread_list.end());
}
void Scheduler::ScheduleThread(Thread* thread, u32 priority) {
- std::lock_guard<std::mutex> lock(scheduler_mutex);
+ std::lock_guard lock{scheduler_mutex};
ASSERT(thread->GetStatus() == ThreadStatus::Ready);
ready_queue.add(thread, priority);
}
void Scheduler::UnscheduleThread(Thread* thread, u32 priority) {
- std::lock_guard<std::mutex> lock(scheduler_mutex);
+ std::lock_guard lock{scheduler_mutex};
ASSERT(thread->GetStatus() == ThreadStatus::Ready);
ready_queue.remove(thread, priority);
}
void Scheduler::SetThreadPriority(Thread* thread, u32 priority) {
- std::lock_guard<std::mutex> lock(scheduler_mutex);
+ std::lock_guard lock{scheduler_mutex};
if (thread->GetPriority() == priority) {
return;
}
@@ -187,7 +187,7 @@ void Scheduler::SetThreadPriority(Thread* thread, u32 priority) {
}
Thread* Scheduler::GetNextSuggestedThread(u32 core, u32 maximum_priority) const {
- std::lock_guard<std::mutex> lock(scheduler_mutex);
+ std::lock_guard lock{scheduler_mutex};
const u32 mask = 1U << core;
for (auto* thread : ready_queue) {