mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-30 07:20:13 +00:00
Minor fix of sys_lwmutex_destroy
This commit is contained in:
parent
1e5f6ba39c
commit
cec976b70a
@ -108,30 +108,32 @@ struct lv2_lwmutex final : lv2_obj
|
||||
}
|
||||
}).signaled;
|
||||
|
||||
const bool notify = lwcond_waiters.fetch_op([](s32& val)
|
||||
{
|
||||
if (val + 0u <= 1u << 31)
|
||||
{
|
||||
// Value was either positive or INT32_MIN
|
||||
return false;
|
||||
}
|
||||
|
||||
// lwmutex was set to be destroyed, but there are lwcond waiters
|
||||
// Turn off the "lwcond_waiters notification" bit as we are adding an lwmutex waiter
|
||||
val &= 0x7fff'ffff;
|
||||
return true;
|
||||
}).second;
|
||||
|
||||
if (notify)
|
||||
{
|
||||
// Notify lwmutex destroyer (may cause EBUSY to be returned for it)
|
||||
lwcond_waiters.notify_all();
|
||||
}
|
||||
|
||||
if (signal)
|
||||
{
|
||||
cpu->next_cpu = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
const bool notify = lwcond_waiters.fetch_op([](s32& val)
|
||||
{
|
||||
if (val + 0u <= 1u << 31)
|
||||
{
|
||||
// Value was either positive or INT32_MIN
|
||||
return false;
|
||||
}
|
||||
|
||||
// lwmutex was set to be destroyed, but there are lwcond waiters
|
||||
// Turn off the "lwcond_waiters notification" bit as we are adding an lwmutex waiter
|
||||
val &= 0x7fff'ffff;
|
||||
return true;
|
||||
}).second;
|
||||
|
||||
if (notify)
|
||||
{
|
||||
// Notify lwmutex destroyer (may cause EBUSY to be returned for it)
|
||||
lwcond_waiters.notify_all();
|
||||
}
|
||||
}
|
||||
|
||||
return signal;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user