From 42f5fd0ab32b117901d0cae228103811719606ff Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 4 Jun 2019 19:52:42 -0400 Subject: core/core_timing_util: Use std::chrono types for specifying time units Makes the interface more type-safe and consistent in terms of return values. --- src/core/hle/kernel/thread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/hle/kernel/thread.cpp') diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 2abf9efca..c73a40977 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -75,9 +75,9 @@ void Thread::WakeAfterDelay(s64 nanoseconds) { // This function might be called from any thread so we have to be cautious and use the // thread-safe version of ScheduleEvent. + const s64 cycles = Core::Timing::nsToCycles(std::chrono::nanoseconds{nanoseconds}); Core::System::GetInstance().CoreTiming().ScheduleEventThreadsafe( - Core::Timing::nsToCycles(nanoseconds), kernel.ThreadWakeupCallbackEventType(), - callback_handle); + cycles, kernel.ThreadWakeupCallbackEventType(), callback_handle); } void Thread::CancelWakeupTimer() { -- cgit v1.2.3