summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/timer.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/timer.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp
index b50cf520d..60537f355 100644
--- a/src/core/hle/kernel/timer.cpp
+++ b/src/core/hle/kernel/timer.cpp
@@ -31,20 +31,15 @@ SharedPtr<Timer> Timer::Create(ResetType reset_type, std::string name) {
timer->interval_delay = 0;
timer->callback_handle = timer_callback_handle_table.Create(timer).MoveFrom();
- if (reset_type == ResetType::Pulse) {
- LOG_ERROR(Kernel, "Unimplemented timer reset type Pulse");
- UNIMPLEMENTED();
- }
-
return timer;
}
-bool Timer::ShouldWait() {
+bool Timer::ShouldWait(Thread* thread) const {
return !signaled;
}
-void Timer::Acquire() {
- ASSERT_MSG(!ShouldWait(), "object unavailable!");
+void Timer::Acquire(Thread* thread) {
+ ASSERT_MSG(!ShouldWait(thread), "object unavailable!");
if (reset_type == ResetType::OneShot)
signaled = false;
@@ -70,6 +65,13 @@ void Timer::Clear() {
signaled = false;
}
+void Timer::WakeupAllWaitingThreads() {
+ WaitObject::WakeupAllWaitingThreads();
+
+ if (reset_type == ResetType::Pulse)
+ signaled = false;
+}
+
/// The timer callback event, called when a timer is fired
static void TimerCallback(u64 timer_handle, int cycles_late) {
SharedPtr<Timer> timer =