mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 09:48:37 +12:00
sys_cond_wait: Fix mutex acquire when signaling thread didnt pass ownership immediatly
This commit is contained in:
parent
ab02c56725
commit
b03c2fc856
1 changed files with 10 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "sys_cond.h"
|
#include "sys_cond.h"
|
||||||
|
|
||||||
#include "Emu/System.h"
|
#include "Emu/System.h"
|
||||||
|
@ -273,17 +273,21 @@ error_code sys_cond_wait(ppu_thread& ppu, u32 cond_id, u64 timeout)
|
||||||
ppu.gpr[3] = CELL_ETIMEDOUT;
|
ppu.gpr[3] = CELL_ETIMEDOUT;
|
||||||
|
|
||||||
// Own or requeue
|
// Own or requeue
|
||||||
if (!cond->mutex->try_own(ppu, ppu.id))
|
if (cond->mutex->try_own(ppu, ppu.id))
|
||||||
{
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (cond->mutex->owner >> 1 == ppu.id)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
cond->mutex->sleep(ppu);
|
cond->mutex->sleep(ppu);
|
||||||
timeout = 0;
|
timeout = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
thread_ctrl::wait();
|
thread_ctrl::wait();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue