Files
AnyPS5/core/libs/prx/libkernel/Pthread
3fcafeb420 fix(libkernel): keep the thread stack lock alive through static destruction
#9272 keeps liveStacks and protectedStackPages alive through static
destruction so that a late mprotect from an atexit handler can still
look up guest thread stacks. The mutex guarding them is still a static
std::mutex. libstdc++'s std::mutex has a trivial destructor, so it keeps
working on Linux, but libc++ destroys the pthread mutex, and a later lock
throws "mutex lock failed: Invalid argument": on macOS the exit probe of
guest_memory_lifetime fails at its mapping protection stage. The lock is
now allocated and never destroyed, like the maps.

The same change is part of #7201 and #8658.

Co-Authored-By: marion909 <103169397+marion909@users.noreply.github.com>
Co-Authored-By: iamthehimansh <67262056+iamthehimansh@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 20:19:51 -04:00
..