Files
AnyPS5/core/libs/prx/libkernel/Pthread
Lindamea1andClaude Opus 5.5 c68ffcfd21 fix(libkernel): fail scePthreadMutexUnlock on a statically initialized mutex with EPERM
scePthreadMutexUnlock resolved the slot with resolveMutex(mutex, false),
which throws "Mutex is not initialized" while the slot still holds the
static initializer (0) or the adaptive static initializer (1), so
unlocking a statically initialized mutex that was never locked ended
the process. FreeBSD 11.4's mutex_unlock_common returns EPERM for both
without initializing the slot, and EINVAL for the destroyed marker.

Load the slot once: the destroyed marker still returns 0x80020016, and
the two initializers now return 0x80020001 and stay in the slot, so a
later lock still creates the mutex.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 19:31:14 +01:00
..