diff options
author | bunnei <bunneidev@gmail.com> | 2015-01-15 01:22:50 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-01-22 00:41:00 +0100 |
commit | c22bac6398ff1705992fc44b2c29775c84cff662 (patch) | |
tree | e20da7e6e1824c19b7ced73f43815397749ffae7 /src/core/hle/kernel/timer.cpp | |
parent | Merge pull request #491 from archshift/hidspvr (diff) | |
download | yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.gz yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.bz2 yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.lz yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.xz yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.zst yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.zip |
Diffstat (limited to 'src/core/hle/kernel/timer.cpp')
-rw-r--r-- | src/core/hle/kernel/timer.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index 3b0452d4d..2d4fa4c01 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp @@ -13,7 +13,7 @@ namespace Kernel { -class Timer : public Object { +class Timer : public WaitObject { public: std::string GetTypeName() const override { return "Timer"; } std::string GetName() const override { return name; } @@ -24,7 +24,6 @@ public: ResetType reset_type; ///< The ResetType of this timer bool signaled; ///< Whether the timer has been signaled or not - std::set<Handle> waiting_threads; ///< Threads that are waiting for the timer std::string name; ///< Name of timer (optional) u64 initial_delay; ///< The delay until the timer fires for the first time @@ -33,7 +32,7 @@ public: ResultVal<bool> WaitSynchronization() override { bool wait = !signaled; if (wait) { - waiting_threads.insert(GetCurrentThread()->GetHandle()); + AddWaitingThread(GetCurrentThread()); Kernel::WaitCurrentThread(WAITTYPE_TIMER, this); } return MakeResult<bool>(wait); @@ -92,12 +91,7 @@ static void TimerCallback(u64 timer_handle, int cycles_late) { timer->signaled = true; // Resume all waiting threads - for (Handle thread_handle : timer->waiting_threads) { - if (SharedPtr<Thread> thread = Kernel::g_handle_table.Get<Thread>(thread_handle)) - thread->ResumeFromWait(); - } - - timer->waiting_threads.clear(); + timer->ResumeAllWaitingThreads(); if (timer->reset_type == RESETTYPE_ONESHOT) timer->signaled = false; |