fix(libkernel): return EDEADLK for self-join and EINVAL for null threads #4063
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4063"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T22:27:39Z.
What
Carry Hussein Kadhim’s fix from issue #4052, preserving his implementation commit authorship. Null
scePthreadJoin/scePthreadDetachand POSIXpthread_join/pthread_detachcalls now returnEINVAL; a joinable thread joining itself returnsEDEADLK. Regression cases cover the guest and POSIX entry points.The existing detached-thread check order remains unchanged. As described in the issue, self-join on a detached or adopted main thread still returns
EINVALrather thanEDEADLK.Tested
guest_thread_self_tests; CTestguest_thread_selfpassed (1/1).guest_thread_selffails on main and passes with the fix;guest_ampr_threadsandguest_pthread_cancelpass. I did not run Windows locally.git diff --checkpassed.Checklist
mainImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T22:27:45Z.
I independently built guest_thread_self_tests with GCC 12.2 in Release on Linux and ran CTest guest_thread_self; it passed (1/1). The open-PR overlap checker found no overlap, and the local conventions and diff checks pass. Windows coverage remains the issue author’s report, not a local run.