mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 08:33:12 -05:00
scePthreadAttrGet copied the attributes of any non-null handle, so a thread that was joined or had finished still answered 0, and a thread that ended detached was read after its object had been freed. FreeBSD 11.4's _pthread_attr_get_np returns ESRCH for a dead or reclaimed thread, and Monster Hunter Wilds (PPSA24191) reuses a slot of its thread table only when scePthreadAttrGet returns 0x80020003. After the EINVAL checks it now returns ESRCH unless the handle is a live guest thread, and copies the fields while holding the thread registry lock (LockLiveGuestThread), so a detached thread exiting during the call is not freed under the copy. GuestThreadIsLive uses the same lookup. pthread_attr_get_np, which the title does not import, is left as it is; the debt entry records the difference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>