Savestates: Fix sys_rwlock_wunlock saving

This commit is contained in:
Eladash 2022-07-20 15:21:08 +03:00 committed by Ivan
parent ce01457510
commit bb9ae18c71

View File

@ -520,6 +520,15 @@ error_code sys_rwlock_wunlock(ppu_thread& ppu, u32 rw_lock_id)
}
else if (auto readers = rwlock->rq.size())
{
for (auto cpu : rwlock->rq)
{
if (static_cast<ppu_thread*>(cpu)->state & cpu_flag::again)
{
ppu.state += cpu_flag::again;
return {};
}
}
for (auto cpu : ::as_rvalue(std::move(rwlock->rq)))
{
rwlock->append(cpu);