mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00: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 "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
|
||||
|
|
Loading…
Add table
Reference in a new issue