1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 20:22:30 +01:00

lv2: Wait for rescheduling before confirming ETIMEOUT

This commit is contained in:
Eladash 2019-08-25 10:05:05 +03:00 committed by Ivan
parent 35a3bed91a
commit a921fe3351
7 changed files with 24 additions and 0 deletions

View File

@ -292,6 +292,9 @@ error_code sys_event_queue_receive(ppu_thread& ppu, u32 equeue_id, vm::ptr<sys_e
{
if (lv2_obj::wait_timeout(timeout, &ppu))
{
// Wait for rescheduling
ppu.check_state();
std::lock_guard lock(queue->mutex);
if (!queue->unqueue(queue->sq, &ppu))

View File

@ -171,6 +171,9 @@ error_code sys_event_flag_wait(ppu_thread& ppu, u32 id, u64 bitptn, u32 mode, vm
{
if (lv2_obj::wait_timeout(timeout, &ppu))
{
// Wait for rescheduling
ppu.check_state();
std::lock_guard lock(flag->mutex);
if (!flag->unqueue(flag->sq, &ppu))

View File

@ -325,6 +325,9 @@ error_code _sys_lwcond_queue_wait(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id
{
if (lv2_obj::wait_timeout(timeout, &ppu))
{
// Wait for rescheduling
ppu.check_state();
std::lock_guard lock(cond->mutex);
if (!cond->unqueue(cond->sq, &ppu))

View File

@ -130,6 +130,9 @@ error_code _sys_lwmutex_lock(ppu_thread& ppu, u32 lwmutex_id, u64 timeout)
{
if (lv2_obj::wait_timeout(timeout, &ppu))
{
// Wait for rescheduling
ppu.check_state();
std::lock_guard lock(mutex->mutex);
if (!mutex->unqueue(mutex->sq, &ppu))

View File

@ -165,6 +165,9 @@ error_code sys_mutex_lock(ppu_thread& ppu, u32 mutex_id, u64 timeout)
{
if (lv2_obj::wait_timeout(timeout, &ppu))
{
// Wait for rescheduling
ppu.check_state();
std::lock_guard lock(mutex->mutex);
if (!mutex->unqueue(mutex->sq, &ppu))

View File

@ -140,6 +140,9 @@ error_code sys_rwlock_rlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout)
{
if (lv2_obj::wait_timeout(timeout, &ppu))
{
// Wait for rescheduling
ppu.check_state();
std::lock_guard lock(rwlock->mutex);
if (!rwlock->unqueue(rwlock->rq, &ppu))
@ -337,6 +340,9 @@ error_code sys_rwlock_wlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout)
{
if (lv2_obj::wait_timeout(timeout, &ppu))
{
// Wait for rescheduling
ppu.check_state();
std::lock_guard lock(rwlock->mutex);
if (!rwlock->unqueue(rwlock->wq, &ppu))

View File

@ -131,6 +131,9 @@ error_code sys_semaphore_wait(ppu_thread& ppu, u32 sem_id, u64 timeout)
{
if (lv2_obj::wait_timeout(timeout, &ppu))
{
// Wait for rescheduling
ppu.check_state();
std::lock_guard lock(sem->mutex);
if (!sem->unqueue(sem->sq, &ppu))