diff --git a/src/core/libraries/kernel/threads/rwlock.cpp b/src/core/libraries/kernel/threads/rwlock.cpp index affaaf99..ff211e48 100644 --- a/src/core/libraries/kernel/threads/rwlock.cpp +++ b/src/core/libraries/kernel/threads/rwlock.cpp @@ -177,13 +177,13 @@ int PS4_SYSV_ABI posix_pthread_rwlock_unlock(PthreadRwlockT* rwlock) { } if (prwlock->owner == curthread) { - prwlock->lock.unlock(); prwlock->owner = nullptr; + prwlock->lock.unlock(); } else { - prwlock->lock.unlock_shared(); if (prwlock->owner == nullptr) { curthread->rdlock_count--; } + prwlock->lock.unlock_shared(); } return 0;