mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-08 16:05:56 +00:00
SC_Lwcond fixed
This commit is contained in:
parent
d0ea397492
commit
be80a7c39c
4 changed files with 96 additions and 95 deletions
|
|
@ -206,10 +206,11 @@ int sys_lwmutex_t::trylock(be_t<u32> tid)
|
|||
{
|
||||
if (attribute.ToBE() == se32(0xDEADBEEF)) return CELL_EINVAL;
|
||||
|
||||
be_t<u32> owner_tid = mutex.GetOwner();
|
||||
be_t<u32> owner_tid = mutex.GetFreeValue();
|
||||
|
||||
if (owner_tid != mutex.GetFreeValue())
|
||||
if (mutex.unlock(owner_tid, owner_tid) != SMR_OK) // check free value
|
||||
{
|
||||
owner_tid = mutex.GetOwner();
|
||||
if (CPUThread* tt = Emu.GetCPU().GetThread(owner_tid))
|
||||
{
|
||||
if (!tt->IsAlive())
|
||||
|
|
@ -263,7 +264,7 @@ int sys_lwmutex_t::trylock(be_t<u32> tid)
|
|||
|
||||
int sys_lwmutex_t::unlock(be_t<u32> tid)
|
||||
{
|
||||
if (tid != mutex.GetOwner())
|
||||
if (mutex.unlock(tid, tid) != SMR_OK)
|
||||
{
|
||||
return CELL_EPERM;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue