diff options
Diffstat (limited to 'src/core/hle/kernel/timer.cpp')
| -rw-r--r-- | src/core/hle/kernel/timer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index 685a202c0..3b0452d4d 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp | |||
| @@ -66,7 +66,7 @@ ResultCode CreateTimer(Handle* handle, const ResetType reset_type, const std::st | |||
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | ResultCode ClearTimer(Handle handle) { | 68 | ResultCode ClearTimer(Handle handle) { |
| 69 | Timer* timer = Kernel::g_handle_table.Get<Timer>(handle); | 69 | SharedPtr<Timer> timer = Kernel::g_handle_table.Get<Timer>(handle); |
| 70 | 70 | ||
| 71 | if (timer == nullptr) | 71 | if (timer == nullptr) |
| 72 | return InvalidHandle(ErrorModule::Kernel); | 72 | return InvalidHandle(ErrorModule::Kernel); |
| @@ -80,7 +80,7 @@ static int TimerCallbackEventType = -1; | |||
| 80 | 80 | ||
| 81 | /// The timer callback event, called when a timer is fired | 81 | /// The timer callback event, called when a timer is fired |
| 82 | static void TimerCallback(u64 timer_handle, int cycles_late) { | 82 | static void TimerCallback(u64 timer_handle, int cycles_late) { |
| 83 | Timer* timer = Kernel::g_handle_table.Get<Timer>(timer_handle); | 83 | SharedPtr<Timer> timer = Kernel::g_handle_table.Get<Timer>(timer_handle); |
| 84 | 84 | ||
| 85 | if (timer == nullptr) { | 85 | if (timer == nullptr) { |
| 86 | LOG_CRITICAL(Kernel, "Callback fired for invalid timer %u", timer_handle); | 86 | LOG_CRITICAL(Kernel, "Callback fired for invalid timer %u", timer_handle); |
| @@ -93,7 +93,7 @@ static void TimerCallback(u64 timer_handle, int cycles_late) { | |||
| 93 | 93 | ||
| 94 | // Resume all waiting threads | 94 | // Resume all waiting threads |
| 95 | for (Handle thread_handle : timer->waiting_threads) { | 95 | for (Handle thread_handle : timer->waiting_threads) { |
| 96 | if (Thread* thread = Kernel::g_handle_table.Get<Thread>(thread_handle)) | 96 | if (SharedPtr<Thread> thread = Kernel::g_handle_table.Get<Thread>(thread_handle)) |
| 97 | thread->ResumeFromWait(); | 97 | thread->ResumeFromWait(); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| @@ -111,7 +111,7 @@ static void TimerCallback(u64 timer_handle, int cycles_late) { | |||
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | ResultCode SetTimer(Handle handle, s64 initial, s64 interval) { | 113 | ResultCode SetTimer(Handle handle, s64 initial, s64 interval) { |
| 114 | Timer* timer = Kernel::g_handle_table.Get<Timer>(handle); | 114 | SharedPtr<Timer> timer = Kernel::g_handle_table.Get<Timer>(handle); |
| 115 | 115 | ||
| 116 | if (timer == nullptr) | 116 | if (timer == nullptr) |
| 117 | return InvalidHandle(ErrorModule::Kernel); | 117 | return InvalidHandle(ErrorModule::Kernel); |
| @@ -125,7 +125,7 @@ ResultCode SetTimer(Handle handle, s64 initial, s64 interval) { | |||
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | ResultCode CancelTimer(Handle handle) { | 127 | ResultCode CancelTimer(Handle handle) { |
| 128 | Timer* timer = Kernel::g_handle_table.Get<Timer>(handle); | 128 | SharedPtr<Timer> timer = Kernel::g_handle_table.Get<Timer>(handle); |
| 129 | 129 | ||
| 130 | if (timer == nullptr) | 130 | if (timer == nullptr) |
| 131 | return InvalidHandle(ErrorModule::Kernel); | 131 | return InvalidHandle(ErrorModule::Kernel); |