summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/timer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/timer.cpp')
-rw-r--r--src/core/hle/kernel/timer.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp
index 7ac669e31..685a202c0 100644
--- a/src/core/hle/kernel/timer.cpp
+++ b/src/core/hle/kernel/timer.cpp
@@ -33,8 +33,8 @@ public:
33 ResultVal<bool> WaitSynchronization() override { 33 ResultVal<bool> WaitSynchronization() override {
34 bool wait = !signaled; 34 bool wait = !signaled;
35 if (wait) { 35 if (wait) {
36 waiting_threads.insert(GetCurrentThreadHandle()); 36 waiting_threads.insert(GetCurrentThread()->GetHandle());
37 Kernel::WaitCurrentThread(WAITTYPE_TIMER, GetHandle()); 37 Kernel::WaitCurrentThread(WAITTYPE_TIMER, this);
38 } 38 }
39 return MakeResult<bool>(wait); 39 return MakeResult<bool>(wait);
40 } 40 }
@@ -92,8 +92,10 @@ static void TimerCallback(u64 timer_handle, int cycles_late) {
92 timer->signaled = true; 92 timer->signaled = true;
93 93
94 // Resume all waiting threads 94 // Resume all waiting threads
95 for (Handle thread : timer->waiting_threads) 95 for (Handle thread_handle : timer->waiting_threads) {
96 ResumeThreadFromWait(thread); 96 if (Thread* thread = Kernel::g_handle_table.Get<Thread>(thread_handle))
97 thread->ResumeFromWait();
98 }
97 99
98 timer->waiting_threads.clear(); 100 timer->waiting_threads.clear();
99 101