summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2020-12-03 22:44:06 -0800
committerGravatar bunnei2020-12-06 00:03:24 -0800
commitbc59ca92b6540efbcf45baab79d0f498eb103f30 (patch)
treeafb08107e4333dcafbb7a64d7f503399fe63fce3 /src
parentkernel: time_manager: Add missing lock guards. (diff)
downloadyuzu-bc59ca92b6540efbcf45baab79d0f498eb103f30.tar.gz
yuzu-bc59ca92b6540efbcf45baab79d0f498eb103f30.tar.xz
yuzu-bc59ca92b6540efbcf45baab79d0f498eb103f30.zip
kernel: KScopedSchedulerLockAndSleep: Remove unused ctor.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h20
1 files changed, 7 insertions, 13 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 f11a62216..16f470923 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
@@ -8,6 +8,7 @@
8#pragma once 8#pragma once
9 9
10#include "common/common_types.h" 10#include "common/common_types.h"
11#include "core/hle/kernel/handle_table.h"
11#include "core/hle/kernel/kernel.h" 12#include "core/hle/kernel/kernel.h"
12#include "core/hle/kernel/thread.h" 13#include "core/hle/kernel/thread.h"
13#include "core/hle/kernel/time_manager.h" 14#include "core/hle/kernel/time_manager.h"
@@ -17,20 +18,16 @@ namespace Kernel {
17class KScopedSchedulerLockAndSleep { 18class KScopedSchedulerLockAndSleep {
18private: 19private:
19 KernelCore& kernel; 20 KernelCore& kernel;
20 s64 timeout_tick{}; 21 Handle& event_handle;
21 Thread* thread{}; 22 Thread* thread{};
22 Handle* event_handle{}; 23 s64 timeout_tick{};
23 24
24public: 25public:
25 explicit KScopedSchedulerLockAndSleep(KernelCore& kernel, Thread* t, s64 timeout)
26 : kernel(kernel), timeout_tick(timeout), thread(t) {
27 /* Lock the scheduler. */
28 kernel.GlobalSchedulerContext().scheduler_lock.Lock();
29 }
30
31 explicit KScopedSchedulerLockAndSleep(KernelCore& kernel, Handle& event_handle, Thread* t, 26 explicit KScopedSchedulerLockAndSleep(KernelCore& kernel, Handle& event_handle, Thread* t,
32 s64 timeout) 27 s64 timeout)
33 : kernel(kernel), event_handle(&event_handle), timeout_tick(timeout), thread(t) { 28 : kernel(kernel), event_handle(event_handle), thread(t), timeout_tick(timeout) {
29 event_handle = InvalidHandle;
30
34 /* Lock the scheduler. */ 31 /* Lock the scheduler. */
35 kernel.GlobalSchedulerContext().scheduler_lock.Lock(); 32 kernel.GlobalSchedulerContext().scheduler_lock.Lock();
36 } 33 }
@@ -38,10 +35,7 @@ public:
38 ~KScopedSchedulerLockAndSleep() { 35 ~KScopedSchedulerLockAndSleep() {
39 /* Register the sleep. */ 36 /* Register the sleep. */
40 if (this->timeout_tick > 0) { 37 if (this->timeout_tick > 0) {
41 auto& time_manager = kernel.TimeManager(); 38 kernel.TimeManager().ScheduleTimeEvent(event_handle, this->thread, this->timeout_tick);
42 Handle handle{};
43 time_manager.ScheduleTimeEvent(event_handle ? *event_handle : handle, this->thread,
44 this->timeout_tick);
45 } 39 }
46 40
47 /* Unlock the scheduler. */ 41 /* Unlock the scheduler. */