From 1776448df2a023f6735b69e27b72664e02f448ee Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 7 Mar 2023 20:48:46 -0500 Subject: kernel: add timer pointer to KThreadQueue --- src/core/hle/kernel/k_thread_queue.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/core/hle/kernel/k_thread_queue.cpp') diff --git a/src/core/hle/kernel/k_thread_queue.cpp b/src/core/hle/kernel/k_thread_queue.cpp index 5f1dc97eb..fe648447b 100644 --- a/src/core/hle/kernel/k_thread_queue.cpp +++ b/src/core/hle/kernel/k_thread_queue.cpp @@ -22,7 +22,9 @@ void KThreadQueue::EndWait(KThread* waiting_thread, Result wait_result) { waiting_thread->ClearWaitQueue(); // Cancel the thread task. - kernel.HardwareTimer().CancelTask(waiting_thread); + if (m_hardware_timer != nullptr) { + m_hardware_timer->CancelTask(waiting_thread); + } } void KThreadQueue::CancelWait(KThread* waiting_thread, Result wait_result, bool cancel_timer_task) { @@ -36,8 +38,8 @@ void KThreadQueue::CancelWait(KThread* waiting_thread, Result wait_result, bool waiting_thread->ClearWaitQueue(); // Cancel the thread task. - if (cancel_timer_task) { - kernel.HardwareTimer().CancelTask(waiting_thread); + if (cancel_timer_task && m_hardware_timer != nullptr) { + m_hardware_timer->CancelTask(waiting_thread); } } -- cgit v1.2.3