summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/timer.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2015-12-29 22:36:29 -0500
committerGravatar bunnei2015-12-29 22:36:29 -0500
commit4bc961d5fd105f894f4f993b693b2496d14dc773 (patch)
tree2dafa3f03da381282734de0c68cb43916f37c346 /src/core/hle/kernel/timer.cpp
parentMerge pull request #1303 from lioncash/unique (diff)
parentHLE/Timers: Reset OneShot timers when they are acquired instead of when they'... (diff)
downloadyuzu-4bc961d5fd105f894f4f993b693b2496d14dc773.tar.gz
yuzu-4bc961d5fd105f894f4f993b693b2496d14dc773.tar.xz
yuzu-4bc961d5fd105f894f4f993b693b2496d14dc773.zip
Merge pull request #1306 from Subv/sync
HLE/Timers: Reset OneShot timers when they are acquired instead of when they're triggered
Diffstat (limited to 'src/core/hle/kernel/timer.cpp')
-rw-r--r--src/core/hle/kernel/timer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp
index 08b3ea8c0..ce6bbd719 100644
--- a/src/core/hle/kernel/timer.cpp
+++ b/src/core/hle/kernel/timer.cpp
@@ -42,6 +42,9 @@ bool Timer::ShouldWait() {
42 42
43void Timer::Acquire() { 43void Timer::Acquire() {
44 ASSERT_MSG( !ShouldWait(), "object unavailable!"); 44 ASSERT_MSG( !ShouldWait(), "object unavailable!");
45
46 if (reset_type == RESETTYPE_ONESHOT)
47 signaled = false;
45} 48}
46 49
47void Timer::Set(s64 initial, s64 interval) { 50void Timer::Set(s64 initial, s64 interval) {
@@ -84,9 +87,6 @@ static void TimerCallback(u64 timer_handle, int cycles_late) {
84 // Resume all waiting threads 87 // Resume all waiting threads
85 timer->WakeupAllWaitingThreads(); 88 timer->WakeupAllWaitingThreads();
86 89
87 if (timer->reset_type == RESETTYPE_ONESHOT)
88 timer->signaled = false;
89
90 if (timer->interval_delay != 0) { 90 if (timer->interval_delay != 0) {
91 // Reschedule the timer with the interval delay 91 // Reschedule the timer with the interval delay
92 u64 interval_microseconds = timer->interval_delay / 1000; 92 u64 interval_microseconds = timer->interval_delay / 1000;