LV2: Race condition fixup
This commit is contained in:
@@ -524,6 +524,7 @@ error_code sys_event_queue_receive(ppu_thread& ppu, u32 equeue_id, vm::ptr<sys_e
|
|||||||
if (!atomic_storage<ppu_thread*>::load(queue->pq))
|
if (!atomic_storage<ppu_thread*>::load(queue->pq))
|
||||||
{
|
{
|
||||||
// Waiters queue is empty, so the thread must have been signaled
|
// Waiters queue is empty, so the thread must have been signaled
|
||||||
|
queue->mutex.lock_unlock();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -243,6 +243,7 @@ error_code sys_event_flag_wait(ppu_thread& ppu, u32 id, u64 bitptn, u32 mode, vm
|
|||||||
if (!atomic_storage<ppu_thread*>::load(flag->sq))
|
if (!atomic_storage<ppu_thread*>::load(flag->sq))
|
||||||
{
|
{
|
||||||
// Waiters queue is empty, so the thread must have been signaled
|
// Waiters queue is empty, so the thread must have been signaled
|
||||||
|
flag->mutex.lock_unlock();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -237,6 +237,7 @@ error_code _sys_lwmutex_lock(ppu_thread& ppu, u32 lwmutex_id, u64 timeout)
|
|||||||
if (!mutex->load_sq())
|
if (!mutex->load_sq())
|
||||||
{
|
{
|
||||||
// Sleep queue is empty, so the thread must have been signaled
|
// Sleep queue is empty, so the thread must have been signaled
|
||||||
|
mutex->mutex.lock_unlock();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -258,6 +258,7 @@ error_code sys_mutex_lock(ppu_thread& ppu, u32 mutex_id, u64 timeout)
|
|||||||
if (!atomic_storage<ppu_thread*>::load(mutex->control.raw().sq))
|
if (!atomic_storage<ppu_thread*>::load(mutex->control.raw().sq))
|
||||||
{
|
{
|
||||||
// Waiters queue is empty, so the thread must have been signaled
|
// Waiters queue is empty, so the thread must have been signaled
|
||||||
|
mutex->mutex.lock_unlock();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -199,6 +199,7 @@ error_code sys_rwlock_rlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout)
|
|||||||
if (!atomic_storage<ppu_thread*>::load(rwlock->rq))
|
if (!atomic_storage<ppu_thread*>::load(rwlock->rq))
|
||||||
{
|
{
|
||||||
// Waiters queue is empty, so the thread must have been signaled
|
// Waiters queue is empty, so the thread must have been signaled
|
||||||
|
rwlock->mutex.lock_unlock();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user