summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorGravatar Subv2017-01-04 10:53:01 -0500
committerGravatar Subv2017-01-05 09:40:14 -0500
commitfd95b6ee2606da4cd47c5f2916ad3b4f86c0e0f4 (patch)
tree5a3d1487e24f089b68358ddd8984c12e65623055 /src/core/hle/kernel/kernel.cpp
parentKernel: Use different thread statuses when a thread calls WaitSynchronization... (diff)
downloadyuzu-fd95b6ee2606da4cd47c5f2916ad3b4f86c0e0f4.tar.gz
yuzu-fd95b6ee2606da4cd47c5f2916ad3b4f86c0e0f4.tar.xz
yuzu-fd95b6ee2606da4cd47c5f2916ad3b4f86c0e0f4.zip
Kernel: Remove Thread::wait_objects_index and use wait_objects to hold all the objects that a thread is waiting on.
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;