mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
sys_cond_wait: Wait for rescheduling before relocking
This commit is contained in:
parent
3317e13b64
commit
35a3bed91a
1 changed files with 5 additions and 0 deletions
|
@ -264,6 +264,9 @@ error_code sys_cond_wait(ppu_thread& ppu, u32 cond_id, u64 timeout)
|
||||||
{
|
{
|
||||||
if (lv2_obj::wait_timeout(timeout, &ppu))
|
if (lv2_obj::wait_timeout(timeout, &ppu))
|
||||||
{
|
{
|
||||||
|
// Wait for rescheduling
|
||||||
|
ppu.check_state();
|
||||||
|
|
||||||
std::lock_guard lock(cond->mutex->mutex);
|
std::lock_guard lock(cond->mutex->mutex);
|
||||||
|
|
||||||
// Try to cancel the waiting
|
// Try to cancel the waiting
|
||||||
|
@ -278,6 +281,8 @@ error_code sys_cond_wait(ppu_thread& ppu, u32 cond_id, u64 timeout)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cond->mutex->sleep(ppu);
|
||||||
}
|
}
|
||||||
|
|
||||||
timeout = 0;
|
timeout = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue