diff options
author | bunnei <bunneidev@gmail.com> | 2015-07-21 18:11:48 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-07-21 18:11:48 +0200 |
commit | dcc8f1bef2035c77f06de5af0decbe62e4301b55 (patch) | |
tree | fc382bb2146605e300c48820a6a5e546994b44aa | |
parent | Merge pull request #929 from neobrain/geoshader_definitions (diff) | |
parent | Kernel/Scheduling: Clean up a thread's wait_objects when its scheduled. (diff) | |
download | yuzu-dcc8f1bef2035c77f06de5af0decbe62e4301b55.tar yuzu-dcc8f1bef2035c77f06de5af0decbe62e4301b55.tar.gz yuzu-dcc8f1bef2035c77f06de5af0decbe62e4301b55.tar.bz2 yuzu-dcc8f1bef2035c77f06de5af0decbe62e4301b55.tar.lz yuzu-dcc8f1bef2035c77f06de5af0decbe62e4301b55.tar.xz yuzu-dcc8f1bef2035c77f06de5af0decbe62e4301b55.tar.zst yuzu-dcc8f1bef2035c77f06de5af0decbe62e4301b55.zip |
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 8 |
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) { new_thread->context.pc -= thumb_mode ? 2 : 4; } + // Clean up the thread's wait_objects, they'll be restored if needed during + // the svcWaitSynchronization call + for (int i = 0; i < new_thread->wait_objects.size(); ++i) { + SharedPtr<WaitObject> object = new_thread->wait_objects[i]; + object->RemoveWaitingThread(new_thread); + } + new_thread->wait_objects.clear(); + ready_queue.remove(new_thread->current_priority, new_thread); new_thread->status = THREADSTATUS_RUNNING; |