diff options
| author | Subv <subv2112@gmail.com> | 2016-12-10 13:29:31 -0500 |
|---|---|---|
| committer | Subv <subv2112@gmail.com> | 2016-12-10 13:29:31 -0500 |
| commit | 7066deff789aa012366fef675a828aaf32b17b16 (patch) | |
| tree | f9e355eccba394047b32160e8f7574a74f46772b /src/core/hle/kernel/thread.cpp | |
| parent | d4815e828de3933f8072e35ff49a44340e4316c3 (diff) | |
Properly remove a thread from its wait_objects' waitlist when it is awoken by a timeout.
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 49ed9d8991..4bbc085166 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -277,6 +277,10 @@ static void ThreadWakeupCallback(u64 thread_handle, int cycles_late) { if (thread->status == THREADSTATUS_WAIT_SYNCH || thread->status == THREADSTATUS_WAIT_ARB) { thread->wait_set_output = false; + // Remove the thread from each of its waiting objects' waitlists + for (auto& object : thread->wait_objects) + object->RemoveWaitingThread(thread.get()); + thread->wait_objects.clear(); thread->SetWaitSynchronizationResult(ResultCode(ErrorDescription::Timeout, ErrorModule::OS, ErrorSummary::StatusChanged, ErrorLevel::Info)); |
