summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/cpu_manager.cpp4
-rw-r--r--src/core/hle/kernel/k_scheduler.h5
2 files changed, 8 insertions, 1 deletions
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp
index fd6928105..9fc78f033 100644
--- a/src/core/cpu_manager.cpp
+++ b/src/core/cpu_manager.cpp
@@ -194,7 +194,9 @@ void CpuManager::PreemptSingleCore(bool from_running_enviroment) {
194 { 194 {
195 auto& scheduler = system.Kernel().Scheduler(current_core); 195 auto& scheduler = system.Kernel().Scheduler(current_core);
196 scheduler.Reload(scheduler.GetSchedulerCurrentThread()); 196 scheduler.Reload(scheduler.GetSchedulerCurrentThread());
197 idle_count = 0; 197 if (!scheduler.IsIdle()) {
198 idle_count = 0;
199 }
198 } 200 }
199} 201}
200 202
diff --git a/src/core/hle/kernel/k_scheduler.h b/src/core/hle/kernel/k_scheduler.h
index 3f90656ee..cc3da33f5 100644
--- a/src/core/hle/kernel/k_scheduler.h
+++ b/src/core/hle/kernel/k_scheduler.h
@@ -55,6 +55,11 @@ public:
55 return idle_thread; 55 return idle_thread;
56 } 56 }
57 57
58 /// Returns true if the scheduler is idle
59 [[nodiscard]] bool IsIdle() const {
60 return GetSchedulerCurrentThread() == idle_thread;
61 }
62
58 /// Gets the timestamp for the last context switch in ticks. 63 /// Gets the timestamp for the last context switch in ticks.
59 [[nodiscard]] u64 GetLastContextSwitchTicks() const; 64 [[nodiscard]] u64 GetLastContextSwitchTicks() const;
60 65