diff options
| author | 2022-06-30 16:54:05 -0400 | |
|---|---|---|
| committer | 2022-06-30 16:54:05 -0400 | |
| commit | 2c1e2c63c302dc4a2f0ad3452263d715d77aba8c (patch) | |
| tree | 1996677a825ccabe6a7d497c59d29f8e4672fa66 /src/core/hle/kernel | |
| parent | Merge pull request #7454 from FernandoS27/new-core-timing (diff) | |
| download | yuzu-2c1e2c63c302dc4a2f0ad3452263d715d77aba8c.tar.gz yuzu-2c1e2c63c302dc4a2f0ad3452263d715d77aba8c.tar.xz yuzu-2c1e2c63c302dc4a2f0ad3452263d715d77aba8c.zip | |
cpu_manager: properly check idle on return from preemption
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/k_scheduler.h | 5 |
1 files changed, 5 insertions, 0 deletions
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 | ||