summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/hle/kernel/thread.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 64166ab99..8b49fc7df 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -217,6 +217,14 @@ static void SwitchContext(Thread* new_thread) {
217 new_thread->context.pc -= thumb_mode ? 2 : 4; 217 new_thread->context.pc -= thumb_mode ? 2 : 4;
218 } 218 }
219 219
220 // Clean up the thread's wait_objects, they'll be restored if needed during
221 // the svcWaitSynchronization call
222 for (int i = 0; i < new_thread->wait_objects.size(); ++i) {
223 SharedPtr<WaitObject> object = new_thread->wait_objects[i];
224 object->RemoveWaitingThread(new_thread);
225 }
226 new_thread->wait_objects.clear();
227
220 ready_queue.remove(new_thread->current_priority, new_thread); 228 ready_queue.remove(new_thread->current_priority, new_thread);
221 new_thread->status = THREADSTATUS_RUNNING; 229 new_thread->status = THREADSTATUS_RUNNING;
222 230