From ca08418dc1a02135c3564b34764f364a4130dc03 Mon Sep 17 00:00:00 2001 From: eladash Date: Thu, 2 May 2019 15:16:40 +0300 Subject: [PATCH] Fix sys_rwlock_runlock on waiting readers readers can wait on the sleep queue if a writer lock has been blocked before it, in this case after runlock: writer should acquire the lock but the r's sleep queue is still not empty! --- rpcs3/Emu/Cell/lv2/sys_rwlock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp b/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp index 4aaf4e1655..bcec78bd9a 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp @@ -246,7 +246,7 @@ error_code sys_rwlock_runlock(ppu_thread& ppu, u32 rw_lock_id) { if (const auto cpu = rwlock->schedule(rwlock->wq, rwlock->protocol)) { - rwlock->owner = cpu->id << 1 | !rwlock->wq.empty(); + rwlock->owner = cpu->id << 1 | !rwlock->wq.empty() | !rwlock->rq.empty(); rwlock->awake(*cpu); }