sys_cond_wait: Fix mutex acquire when signaling thread didnt pass ownership immediatly

This commit is contained in:
Eladash 2019-10-14 23:36:48 +03:00 committed by Ivan
parent ab02c56725
commit b03c2fc856

View file

@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.h"
#include "sys_cond.h"
#include "Emu/System.h"
@ -273,15 +273,19 @@ error_code sys_cond_wait(ppu_thread& ppu, u32 cond_id, u64 timeout)
ppu.gpr[3] = CELL_ETIMEDOUT;
// Own or requeue
if (!cond->mutex->try_own(ppu, ppu.id))
if (cond->mutex->try_own(ppu, ppu.id))
{
cond->mutex->sleep(ppu);
timeout = 0;
continue;
break;
}
}
else if (cond->mutex->owner >> 1 == ppu.id)
{
break;
}
break;
cond->mutex->sleep(ppu);
timeout = 0;
continue;
}
}
else