From 803118037336be6a63a950eaadb1970eb0074c47 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 6 Oct 2019 13:30:56 +0300 Subject: [PATCH] Add dummy alert param to thread_ctrl::wait API --- Utilities/Thread.cpp | 2 +- Utilities/Thread.h | 10 +++++----- rpcs3/Emu/Cell/lv2/sys_sync.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index d9b244920f..b99a903ba3 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1777,7 +1777,7 @@ void thread_base::finalize() noexcept --g_thread_count; } -void thread_ctrl::_wait_for(u64 usec) +void thread_ctrl::_wait_for(u64 usec, bool alert /* true */) { auto _this = g_tls_this_thread; diff --git a/Utilities/Thread.h b/Utilities/Thread.h index 714acc0473..9302f3b6d2 100644 --- a/Utilities/Thread.h +++ b/Utilities/Thread.h @@ -188,7 +188,7 @@ class thread_ctrl final static atomic_t g_native_core_layout; // Internal waiting function, may throw. Infinite value is -1. - static void _wait_for(u64 usec); + static void _wait_for(u64 usec, bool alert); friend class thread_base; @@ -238,15 +238,15 @@ public: } // Wait once with timeout. May spuriously return false. - static inline void wait_for(u64 usec) + static inline void wait_for(u64 usec, bool alert = true) { - _wait_for(usec); + _wait_for(usec, alert); } // Wait. static inline void wait() { - _wait_for(-1); + _wait_for(-1, true); } // Wait until pred(). @@ -260,7 +260,7 @@ public: return result; } - _wait_for(-1); + _wait_for(-1, true); } } diff --git a/rpcs3/Emu/Cell/lv2/sys_sync.h b/rpcs3/Emu/Cell/lv2/sys_sync.h index af2acefe3c..4e3fdd9abf 100644 --- a/rpcs3/Emu/Cell/lv2/sys_sync.h +++ b/rpcs3/Emu/Cell/lv2/sys_sync.h @@ -261,7 +261,7 @@ public: if (g_cfg.core.sleep_timers_accuracy < (is_usleep ? sleep_timers_accuracy_level::_usleep : sleep_timers_accuracy_level::_all_timers)) { - thread_ctrl::wait_for(remaining); + thread_ctrl::wait_for(remaining, !is_usleep); } else { @@ -269,10 +269,10 @@ public: { #ifdef __linux__ // Do not wait for the last quantum to avoid loss of accuracy - thread_ctrl::wait_for(remaining - ((remaining % host_min_quantum) + host_min_quantum)); + thread_ctrl::wait_for(remaining - ((remaining % host_min_quantum) + host_min_quantum), !is_usleep); #else // Wait on multiple of min quantum for large durations to avoid overloading low thread cpus - thread_ctrl::wait_for(remaining - (remaining % host_min_quantum)); + thread_ctrl::wait_for(remaining - (remaining % host_min_quantum), !is_usleep); #endif } else