diff options
author | Sebastian Valle <subv2112@gmail.com> | 2017-09-30 16:12:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-30 16:12:18 +0200 |
commit | db752b52e84227696af989c2ec1965020c03fac7 (patch) | |
tree | 04f1e6403bede1890252a0af047e2e149abdde4c /src/core/hle/kernel/wait_object.cpp | |
parent | Merge pull request #2962 from huwpascoe/static_cast (diff) | |
parent | Kernel/Threads: When putting a thread to wait, specify a function to execute when it is awoken. (diff) | |
download | yuzu-db752b52e84227696af989c2ec1965020c03fac7.tar yuzu-db752b52e84227696af989c2ec1965020c03fac7.tar.gz yuzu-db752b52e84227696af989c2ec1965020c03fac7.tar.bz2 yuzu-db752b52e84227696af989c2ec1965020c03fac7.tar.lz yuzu-db752b52e84227696af989c2ec1965020c03fac7.tar.xz yuzu-db752b52e84227696af989c2ec1965020c03fac7.tar.zst yuzu-db752b52e84227696af989c2ec1965020c03fac7.zip |
Diffstat (limited to 'src/core/hle/kernel/wait_object.cpp')
-rw-r--r-- | src/core/hle/kernel/wait_object.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/core/hle/kernel/wait_object.cpp b/src/core/hle/kernel/wait_object.cpp index 56fdd977f..469554908 100644 --- a/src/core/hle/kernel/wait_object.cpp +++ b/src/core/hle/kernel/wait_object.cpp @@ -71,23 +71,20 @@ void WaitObject::WakeupAllWaitingThreads() { while (auto thread = GetHighestPriorityReadyThread()) { if (!thread->IsSleepingOnWaitAll()) { Acquire(thread.get()); - // Set the output index of the WaitSynchronizationN call to the index of this object. - if (thread->wait_set_output) { - thread->SetWaitSynchronizationOutput(thread->GetWaitObjectIndex(this)); - thread->wait_set_output = false; - } } else { for (auto& object : thread->wait_objects) { object->Acquire(thread.get()); } - // Note: This case doesn't update the output index of WaitSynchronizationN. } + // Invoke the wakeup callback before clearing the wait objects + if (thread->wakeup_callback) + thread->wakeup_callback(ThreadWakeupReason::Signal, thread, this); + for (auto& object : thread->wait_objects) object->RemoveWaitingThread(thread.get()); thread->wait_objects.clear(); - thread->SetWaitSynchronizationResult(RESULT_SUCCESS); thread->ResumeFromWait(); } } |