diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-09-10 16:23:43 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-10-15 17:55:13 +0200 |
commit | 103f3a2fe51a09caf3f478226b6957b23c6eff79 (patch) | |
tree | 5304773e043ed3db6a55e4666fc25143560396af /src/core/hle/kernel/svc.cpp | |
parent | Kernel: Style and Corrections (diff) | |
download | yuzu-103f3a2fe51a09caf3f478226b6957b23c6eff79.tar yuzu-103f3a2fe51a09caf3f478226b6957b23c6eff79.tar.gz yuzu-103f3a2fe51a09caf3f478226b6957b23c6eff79.tar.bz2 yuzu-103f3a2fe51a09caf3f478226b6957b23c6eff79.tar.lz yuzu-103f3a2fe51a09caf3f478226b6957b23c6eff79.tar.xz yuzu-103f3a2fe51a09caf3f478226b6957b23c6eff79.tar.zst yuzu-103f3a2fe51a09caf3f478226b6957b23c6eff79.zip |
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r-- | src/core/hle/kernel/svc.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index d520ed033..bd67fc96d 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -1556,17 +1556,18 @@ static void SleepThread(Core::System& system, s64 nanoseconds) { auto& scheduler = system.CurrentScheduler(); auto* const current_thread = scheduler.GetCurrentThread(); + bool redundant = false; if (nanoseconds <= 0) { switch (static_cast<SleepType>(nanoseconds)) { case SleepType::YieldWithoutLoadBalancing: - current_thread->YieldSimple(); + redundant = current_thread->YieldSimple(); break; case SleepType::YieldWithLoadBalancing: - current_thread->YieldAndBalanceLoad(); + redundant = current_thread->YieldAndBalanceLoad(); break; case SleepType::YieldAndWaitForLoadBalancing: - current_thread->YieldAndWaitForLoadBalancing(); + redundant = current_thread->YieldAndWaitForLoadBalancing(); break; default: UNREACHABLE_MSG("Unimplemented sleep yield type '{:016X}'!", nanoseconds); @@ -1575,7 +1576,11 @@ static void SleepThread(Core::System& system, s64 nanoseconds) { current_thread->Sleep(nanoseconds); } - system.PrepareReschedule(current_thread->GetProcessorID()); + if (redundant) { + system.CoreTiming().Idle(); + } else { + system.PrepareReschedule(current_thread->GetProcessorID()); + } } /// Wait process wide key atomic |