aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2016-06-28 21:03:52 -0700
committerGitHub <noreply@github.com>2016-06-28 21:03:52 -0700
commit6bc2f3e2a8b08959ec51b0d80f8917239908fcb6 (patch)
tree9a1d10c098540793d97592c38352aa5d49214286 /src/core/hle/kernel
parent2270d7b0f0a5630c956d64177f5f50cbb405911a (diff)
parent5e5f9b099acd166e59b93ba40e10caa74fb810d0 (diff)
Merge pull request #1869 from wwylele/dont-be-lazy
Switch context to the same thread if necessary
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 492c821e36..9dea995f41 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) {