summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2016-05-29 11:52:29 +0200
committerwwylele <wwylele@gmail.com>2016-05-30 06:34:53 +0200
commit81d3462a199dbaa0c95faa203918cd21d1da1277 (patch)
tree68f17aab52e74156f74e1ace76e5513b04034f7b
parentMerge pull request #1692 from Subv/rm_getpointer2 (diff)
downloadyuzu-81d3462a199dbaa0c95faa203918cd21d1da1277.tar
yuzu-81d3462a199dbaa0c95faa203918cd21d1da1277.tar.gz
yuzu-81d3462a199dbaa0c95faa203918cd21d1da1277.tar.bz2
yuzu-81d3462a199dbaa0c95faa203918cd21d1da1277.tar.lz
yuzu-81d3462a199dbaa0c95faa203918cd21d1da1277.tar.xz
yuzu-81d3462a199dbaa0c95faa203918cd21d1da1277.tar.zst
yuzu-81d3462a199dbaa0c95faa203918cd21d1da1277.zip
-rw-r--r--src/core/hle/kernel/thread.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 3f6bec5fa..db2728a7b 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -542,8 +542,12 @@ void Reschedule() {
HLE::DoneRescheduling();
- // Don't bother switching to the same thread
- if (next == cur)
+ // Don't bother switching to the same thread.
+ // But if the thread was waiting on objects, we still need to switch it
+ // to perform PC modification, change state to RUNNING, etc.
+ // This occurs in the case when an object the thread is waiting on immediately wakes up
+ // the current thread before Reschedule() is called.
+ if (next == cur && (next == nullptr || next->waitsynch_waited == false))
return;
if (cur && next) {