From 3b8bce1bed967082ccb8a4c7490abd137892c563 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Wed, 21 Oct 2020 08:18:27 +0300 Subject: [PATCH] atomic.cpp: fixup for WaitOnAddress path Also fix wait quantum. --- rpcs3/Emu/Cell/lv2/sys_sync.h | 2 +- rpcs3/Emu/RSX/RSXThread.cpp | 4 ++-- rpcs3/util/atomic.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_sync.h b/rpcs3/Emu/Cell/lv2/sys_sync.h index b0f3f49848..80390ae6ba 100644 --- a/rpcs3/Emu/Cell/lv2/sys_sync.h +++ b/rpcs3/Emu/Cell/lv2/sys_sync.h @@ -334,7 +334,7 @@ public: #else // Host scheduler quantum for windows (worst case) // NOTE: On ps3 this function has very high accuracy - constexpr u64 host_min_quantum = 500; + constexpr u64 host_min_quantum = 1000; #endif // TODO: Tune for other non windows operating sytems diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index baa1f0774a..56dfb8446b 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -501,7 +501,7 @@ namespace rsx #ifdef __linux__ constexpr u32 host_min_quantum = 50; #else - constexpr u32 host_min_quantum = 500; + constexpr u32 host_min_quantum = 1000; #endif u64 start_time = get_system_time(); @@ -2543,7 +2543,7 @@ namespace rsx #else // Host scheduler quantum for windows (worst case) // NOTE: On ps3 this function has very high accuracy - constexpr u64 host_min_quantum = 500; + constexpr u64 host_min_quantum = 1000; #endif if (remaining >= host_min_quantum) { diff --git a/rpcs3/util/atomic.cpp b/rpcs3/util/atomic.cpp index fc23ffd66f..b44be0b7c6 100644 --- a/rpcs3/util/atomic.cpp +++ b/rpcs3/util/atomic.cpp @@ -574,7 +574,7 @@ void atomic_storage_futex::wait(const void* data, std::size_t size, u64 old_valu } else { - const DWORD time_ms = timeout + 1 ? INFINITE : (timeout > (UINT32_MAX - 1) * 1000'000 ? (UINT32_MAX - 1) : timeout / 1000'000); + const DWORD time_ms = timeout + 1 ? (timeout > (UINT32_MAX - 1) * 1000'000ull ? (UINT32_MAX - 1) : timeout / 1000'000) : INFINITE; sema_handle _cmp{};