summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2016-06-29 06:03:52 +0200
committerGitHub <noreply@github.com>2016-06-29 06:03:52 +0200
commitde79b6fc4857fde1df3c8a4a2b38d231f2cc961d (patch)
tree9a1d10c098540793d97592c38352aa5d49214286 /src/core/hle/kernel
parentMerge pull request #1867 from mailwl/srv-update (diff)
parentSwitch context on the same thread if necessary (diff)
downloadyuzu-de79b6fc4857fde1df3c8a4a2b38d231f2cc961d.tar
yuzu-de79b6fc4857fde1df3c8a4a2b38d231f2cc961d.tar.gz
yuzu-de79b6fc4857fde1df3c8a4a2b38d231f2cc961d.tar.bz2
yuzu-de79b6fc4857fde1df3c8a4a2b38d231f2cc961d.tar.lz
yuzu-de79b6fc4857fde1df3c8a4a2b38d231f2cc961d.tar.xz
yuzu-de79b6fc4857fde1df3c8a4a2b38d231f2cc961d.tar.zst
yuzu-de79b6fc4857fde1df3c8a4a2b38d231f2cc961d.zip
Diffstat (limited to 'src/core/hle/kernel')
-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 492c821e3..9dea995f4 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -591,8 +591,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) {