From 9b0d33048cfe82eb3382688315e3e7677bbc9ce7 Mon Sep 17 00:00:00 2001 From: Eladash Date: Mon, 8 Aug 2022 22:16:23 +0300 Subject: [PATCH] Savestates/LV2: Fix race on _sys_lwcond_queue_wait saving cpu_flag::again modification requires exclusive access. --- rpcs3/Emu/Cell/lv2/sys_lwcond.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp b/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp index eed31e3706..9d1fa3ddb3 100644 --- a/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp @@ -395,8 +395,7 @@ error_code _sys_lwcond_queue_wait(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id if (is_stopped(state)) { - reader_lock lock(cond->mutex); - reader_lock lock2(mutex->mutex); + std::scoped_lock lock(cond->mutex, mutex->mutex); bool mutex_sleep = false; bool cond_sleep = false;