diff --git a/Utilities/sync.h b/Utilities/sync.h index db46d6104f..6667ccbcf3 100644 --- a/Utilities/sync.h +++ b/Utilities/sync.h @@ -81,9 +81,9 @@ inline int futex(volatile void* uaddr, int futex_op, uint val, const timespec* t { struct waiter { - uint val; - uint mask; - std::condition_variable cv; + uint val; + uint mask; + std::condition_variable cv; }; std::mutex mutex; @@ -111,7 +111,7 @@ inline int futex(volatile void* uaddr, int futex_op, uint val, const timespec* t waiter rec; rec.val = val; rec.mask = mask; - const auto& ref = *map.emplace(uaddr, &rec); + const auto itr = map.emplace(uaddr, &rec); int res = 0; @@ -134,7 +134,7 @@ inline int futex(volatile void* uaddr, int futex_op, uint val, const timespec* t // TODO: absolute timeout } - map.erase(std::find(map.find(uaddr), map.end(), ref)); + map.erase(itr); return res; } diff --git a/rpcs3/Emu/Cell/lv2/lv2.cpp b/rpcs3/Emu/Cell/lv2/lv2.cpp index 263b32992e..3b923e8c41 100644 --- a/rpcs3/Emu/Cell/lv2/lv2.cpp +++ b/rpcs3/Emu/Cell/lv2/lv2.cpp @@ -2228,11 +2228,8 @@ void lv2_obj::notify_all() noexcept break; } - if (cpu != &g_to_notify) - { - // Note: by the time of notification the thread could have been deallocated which is why the direct function is used - atomic_wait_engine::notify_all(cpu); - } + // Note: by the time of notification the thread could have been deallocated which is why the direct function is used + atomic_wait_engine::notify_all(cpu); } g_to_notify[0] = nullptr;