diff options
author | bunnei <bunneidev@gmail.com> | 2021-01-30 08:06:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-30 08:06:40 +0100 |
commit | a4526c4e1acb50808bbe205952101142288e1c60 (patch) | |
tree | 7109edf89606c43352da9de40d0e3a920a08b659 /src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h | |
parent | Merge pull request #5795 from ReinUsesLisp/bytes-to-map-end (diff) | |
parent | hle: kernel: KLightLock: Fix several bugs. (diff) | |
download | yuzu-a4526c4e1acb50808bbe205952101142288e1c60.tar yuzu-a4526c4e1acb50808bbe205952101142288e1c60.tar.gz yuzu-a4526c4e1acb50808bbe205952101142288e1c60.tar.bz2 yuzu-a4526c4e1acb50808bbe205952101142288e1c60.tar.lz yuzu-a4526c4e1acb50808bbe205952101142288e1c60.tar.xz yuzu-a4526c4e1acb50808bbe205952101142288e1c60.tar.zst yuzu-a4526c4e1acb50808bbe205952101142288e1c60.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h | 18 |
1 files changed, 7 insertions, 11 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 2bb3817fa..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 @@ -9,27 +9,24 @@ #include "common/common_types.h" #include "core/hle/kernel/handle_table.h" +#include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/thread.h" #include "core/hle/kernel/time_manager.h" namespace Kernel { class KScopedSchedulerLockAndSleep { public: - explicit KScopedSchedulerLockAndSleep(KernelCore& kernel, Handle& event_handle, Thread* 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,13 +34,12 @@ public: } void CancelSleep() { - this->timeout_tick = 0; + timeout_tick = 0; } private: KernelCore& kernel; - Handle& event_handle; - Thread* thread{}; + KThread* thread{}; s64 timeout_tick{}; }; |