summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/timer.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-01-09 18:59:35 +0100
committerbunnei <bunneidev@gmail.com>2015-01-09 18:59:35 +0100
commit6ae12424df58f0ea171fc75ca4b700ab1fffc192 (patch)
tree93d87f3cb19d08541c6b8f8a9e0ceb730a2b13d9 /src/core/hle/kernel/timer.cpp
parentMerge pull request #436 from kevinhartman/system-core (diff)
parentThread: Fix nullptr access in a logging function (diff)
downloadyuzu-6ae12424df58f0ea171fc75ca4b700ab1fffc192.tar
yuzu-6ae12424df58f0ea171fc75ca4b700ab1fffc192.tar.gz
yuzu-6ae12424df58f0ea171fc75ca4b700ab1fffc192.tar.bz2
yuzu-6ae12424df58f0ea171fc75ca4b700ab1fffc192.tar.lz
yuzu-6ae12424df58f0ea171fc75ca4b700ab1fffc192.tar.xz
yuzu-6ae12424df58f0ea171fc75ca4b700ab1fffc192.tar.zst
yuzu-6ae12424df58f0ea171fc75ca4b700ab1fffc192.zip
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:
ResultVal<bool> WaitSynchronization() override {
bool wait = !signaled;
if (wait) {
- waiting_threads.insert(GetCurrentThreadHandle());
- Kernel::WaitCurrentThread(WAITTYPE_TIMER, GetHandle());
+ waiting_threads.insert(GetCurrentThread()->GetHandle());
+ Kernel::WaitCurrentThread(WAITTYPE_TIMER, this);
}
return MakeResult<bool>(wait);
}
@@ -92,8 +92,10 @@ static void TimerCallback(u64 timer_handle, int cycles_late) {
timer->signaled = true;
// Resume all waiting threads
- for (Handle thread : timer->waiting_threads)
- ResumeThreadFromWait(thread);
+ for (Handle thread_handle : timer->waiting_threads) {
+ if (Thread* thread = Kernel::g_handle_table.Get<Thread>(thread_handle))
+ thread->ResumeFromWait();
+ }
timer->waiting_threads.clear();