1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-26 04:32:35 +01:00

Fix race in sys_lwcond_wait on error code

This commit is contained in:
elad 2019-02-16 20:15:54 +02:00 committed by Ivan
parent 92ff7c4c24
commit 63a9421634

View File

@ -254,6 +254,8 @@ error_code _sys_lwcond_queue_wait(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id
{
sys_lwcond.trace("_sys_lwcond_queue_wait(lwcond_id=0x%x, lwmutex_id=0x%x, timeout=0x%llx)", lwcond_id, lwmutex_id, timeout);
ppu.gpr[3] = CELL_OK;
std::shared_ptr<lv2_lwmutex> mutex;
const auto cond = idm::get<lv2_obj, lv2_lwcond>(lwcond_id, [&](lv2_lwcond& cond) -> cpu_thread*
@ -294,8 +296,6 @@ error_code _sys_lwcond_queue_wait(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id
cond->awake(*cond.ret);
}
ppu.gpr[3] = CELL_OK;
while (!ppu.state.test_and_reset(cpu_flag::signal))
{
if (ppu.is_stopped())