Skip to content

Instantly share code, notes, and snippets.

@Subv
Created May 11, 2015 22:57
Show Gist options
  • Select an option

  • Save Subv/8c1ce6c8866f8a90931c to your computer and use it in GitHub Desktop.

Select an option

Save Subv/8c1ce6c8866f8a90931c to your computer and use it in GitHub Desktop.
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index d85fdb3..b1ba741 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -474,6 +474,10 @@ void Reschedule() {
if (next && prev) {
LOG_TRACE(Kernel, "context switch %u -> %u", prev->GetObjectId(), next->GetObjectId());
} else if (prev) {
+ // Do not reschedule if the current thread can keep running (ie. is not waiting)
+ if (prev->status == THREADSTATUS_RUNNING)
+ return;
+
LOG_TRACE(Kernel, "context switch %u -> idle", prev->GetObjectId());
} else {
LOG_TRACE(Kernel, "context switch idle -> %u", next->GetObjectId());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment