summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 6f61d526a..955f50a9b 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -55,10 +55,16 @@ SharedPtr<Thread> WaitObject::GetHighestPriorityReadyThread() {
55 if (ShouldWait(thread.get())) 55 if (ShouldWait(thread.get()))
56 continue; 56 continue;
57 57
58 bool ready_to_run = std::none_of(thread->wait_objects.begin(), thread->wait_objects.end(), 58 // A thread is ready to run if it's either in THREADSTATUS_WAIT_SYNCH_ANY or
59 // in THREADSTATUS_WAIT_SYNCH_ALL and the rest of the objects it is waiting on are ready.
60 bool ready_to_run = true;
61 if (thread->status == THREADSTATUS_WAIT_SYNCH_ALL) {
62 ready_to_run = std::none_of(thread->wait_objects.begin(), thread->wait_objects.end(),
59 [&thread](const SharedPtr<WaitObject>& object) { 63 [&thread](const SharedPtr<WaitObject>& object) {
60 return object->ShouldWait(thread.get()); 64 return object->ShouldWait(thread.get());
61 }); 65 });
66 }
67
62 if (ready_to_run) { 68 if (ready_to_run) {
63 candidate = thread.get(); 69 candidate = thread.get();
64 candidate_priority = thread->current_priority; 70 candidate_priority = thread->current_priority;