aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/kernel/timer.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner <yuriks@yuriks.net>2014-12-22 11:07:22 -0200
committerGravatar Yuri Kunde Schlesner <yuriks@yuriks.net>2015-01-09 04:02:15 -0200
commit9bf8462b96d34b30f62b8aca745dd558e7f0a450 (patch)
tree32606d5176a82daa4e59bb47bede34d4a941780a /src/core/hle/kernel/timer.cpp
parentba72208cd4905410eab8b996da0fa05fd05c72ff (diff)
Thread: Reduce use of Handles and move some funcs to inside the class.
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 7ac669e3..685a202c 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();