summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-12-04 22:11:32 -0500
committerGravatar Zach Hilman2018-12-04 22:11:32 -0500
commite6f7825a248dd0ff9f2e3fdccabdbe3631622861 (patch)
tree0f262d3fdd0eeda6bc7a11639d6487158f759e5a
parentscheduler: Avoid manual Reschedule call (diff)
downloadyuzu-e6f7825a248dd0ff9f2e3fdccabdbe3631622861.tar.gz
yuzu-e6f7825a248dd0ff9f2e3fdccabdbe3631622861.tar.xz
yuzu-e6f7825a248dd0ff9f2e3fdccabdbe3631622861.zip
svc: Avoid incorrect fast yield condition
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/svc.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 29c2c2d03..e3cf3f909 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -960,11 +960,6 @@ static void ExitThread() {
960static void SleepThread(s64 nanoseconds) { 960static void SleepThread(s64 nanoseconds) {
961 LOG_TRACE(Kernel_SVC, "called nanoseconds={}", nanoseconds); 961 LOG_TRACE(Kernel_SVC, "called nanoseconds={}", nanoseconds);
962 962
963 // Don't attempt to yield execution if there are no available threads to run,
964 // this way we avoid a useless reschedule to the idle thread.
965 if (nanoseconds <= 0 && !Core::System::GetInstance().CurrentScheduler().HaveReadyThreads())
966 return;
967
968 enum class SleepType : s64 { 963 enum class SleepType : s64 {
969 YieldWithoutLoadBalancing = 0, 964 YieldWithoutLoadBalancing = 0,
970 YieldWithLoadBalancing = -1, 965 YieldWithLoadBalancing = -1,
@@ -995,7 +990,7 @@ static void SleepThread(s64 nanoseconds) {
995 } 990 }
996 991
997 // Reschedule all CPU cores 992 // Reschedule all CPU cores
998 for (std::size_t i = 0; i < 4; ++i) 993 for (std::size_t i = 0; i < Core::NUM_CPU_CORES; ++i)
999 Core::System::GetInstance().CpuCore(i).PrepareReschedule(); 994 Core::System::GetInstance().CpuCore(i).PrepareReschedule();
1000} 995}
1001 996