diff options
author | bunnei <bunneidev@gmail.com> | 2021-01-20 06:05:24 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-01-29 06:42:26 +0100 |
commit | c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b (patch) | |
tree | e138e7d0ecb6a306261e2871fd0da405571deaab /src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h | |
parent | common: common_funcs: Add useful kernel macro R_SUCCEED_IF. (diff) | |
download | yuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.tar yuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.tar.gz yuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.tar.bz2 yuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.tar.lz yuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.tar.xz yuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.tar.zst yuzu-c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b.zip |
Diffstat (limited to 'src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h')
-rw-r--r-- | src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h b/src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h index fac39aeb7..f8189e107 100644 --- a/src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h +++ b/src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h @@ -17,19 +17,16 @@ namespace Kernel { class KScopedSchedulerLockAndSleep { public: - explicit KScopedSchedulerLockAndSleep(KernelCore& kernel, Handle& event_handle, KThread* t, - s64 timeout) - : kernel(kernel), event_handle(event_handle), thread(t), timeout_tick(timeout) { - event_handle = InvalidHandle; - + explicit KScopedSchedulerLockAndSleep(KernelCore& kernel, KThread* t, s64 timeout) + : kernel(kernel), thread(t), timeout_tick(timeout) { // Lock the scheduler. kernel.GlobalSchedulerContext().scheduler_lock.Lock(); } ~KScopedSchedulerLockAndSleep() { // Register the sleep. - if (this->timeout_tick > 0) { - kernel.TimeManager().ScheduleTimeEvent(event_handle, this->thread, this->timeout_tick); + if (timeout_tick > 0) { + kernel.TimeManager().ScheduleTimeEvent(thread, timeout_tick); } // Unlock the scheduler. @@ -37,12 +34,11 @@ public: } void CancelSleep() { - this->timeout_tick = 0; + timeout_tick = 0; } private: KernelCore& kernel; - Handle& event_handle; KThread* thread{}; s64 timeout_tick{}; }; |