summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2016-06-28 21:03:52 -0700
committerGravatar GitHub2016-06-28 21:03:52 -0700
commitde79b6fc4857fde1df3c8a4a2b38d231f2cc961d (patch)
tree9a1d10c098540793d97592c38352aa5d49214286 /src/core/hle/kernel/thread.cpp
parentMerge pull request #1867 from mailwl/srv-update (diff)
parentSwitch context on the same thread if necessary (diff)
downloadyuzu-de79b6fc4857fde1df3c8a4a2b38d231f2cc961d.tar.gz
yuzu-de79b6fc4857fde1df3c8a4a2b38d231f2cc961d.tar.xz
yuzu-de79b6fc4857fde1df3c8a4a2b38d231f2cc961d.zip
Merge pull request #1869 from wwylele/dont-be-lazy
Switch context to the same thread if necessary
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
-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() {
591 591
592 HLE::DoneRescheduling(); 592 HLE::DoneRescheduling();
593 593
594 // Don't bother switching to the same thread 594 // Don't bother switching to the same thread.
595 if (next == cur) 595 // But if the thread was waiting on objects, we still need to switch it
596 // to perform PC modification, change state to RUNNING, etc.
597 // This occurs in the case when an object the thread is waiting on immediately wakes up
598 // the current thread before Reschedule() is called.
599 if (next == cur && (next == nullptr || next->waitsynch_waited == false))
596 return; 600 return;
597 601
598 if (cur && next) { 602 if (cur && next) {