feat(libc): export _Thrd_yield #8352
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8352"
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 akkadbakkad89 on 2026-10-20T10:50:55Z.
What
Exports
_Thrd_yield, the last unprovidedlibcimport AC Shadows (PPSA20397) registers from this area: astd::this_thread::yield()wrapper returningthreadSuccess, matching the Dinkumware C_Thrd_*entries this library already serves.The earlier revision of this PR also carried locale facet
_Getcatexports; those are now covered by #9038 and were dropped, and thestd::__sce_v2_Thrdfamily is #8885's scope (its_ZNSt8__sce_v211_Thrd_yieldEvis a different export from this one).Tested
Windows 11 host, WSL build. The added
ThreadHelpersblock inguest_libc_threadsexercises the export from the caller thread and a secondstd::thread.tools/check_conventions.py --base origin/mainclean.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T10:51:44Z.
Progress report (
80565c5→3e0feb4)➖ System libraries: 42.08% (+0.0%, +1 implemented functions)
✅ 1 implemented
_Thrd_yield_nid_postfixImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T22:48:51Z.
@akkadbakkad89 thanks, the facet layouts and return values check out against the console libc (numpunct
_Getcatallocates 0x30 and returns 4 with "", "false" and "true"; codecvt_Getcatallocates 0x10 and returns 2;do_in/do_outreturn noconv).One thing blocks it:
core/libs/tests/GuestLibcThreads.cpp:280: there is an extra}after the newThreadHelpers(). The file has no namespace there, so GCC stops withexpected declaration before '}' tokenandguest_libc_threadsdoes not build. The checks on this PR are green only because pull-request CI does not build the tests.And a small one:
core/libs/prx/libc/src/Threads.cpp: the new#include <pthread.h>under#elseisn't used (the yield goes throughstd::this_thread::yield()), so it can go.Once that is pushed, a full CI run with
guest_locale_facetsandguest_libc_threadspassing on Linux and Windows is the bar.Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-21T05:22:39Z.
Both addressed in
3f138a2326:GuestLibcThreads.cpp:280: stray}removed — my merge resolution had left it behind; the file now compiles.Threads.cpp: the unused#include <pthread.h>under#elseis gone (the block collapses to#ifdef _WIN32 / windows.h / #endif).Verified end-to-end, not just compiled:
guest_libc_threads_testsbuilds and exits 0;guest_locale_facets_testsbuilds and exits 0.guest_libc_threads_tests.exebuilds and exits 0 on this host (Windows 11 Pro 10.0.26300, i7-10700).The Windows run needed the freshly built
libc.prxstaged next to the test — the earlier failure I chased was a stale staged lib, not the test.Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-21T05:40:42Z.
Rebased onto
eb9f904d32— the conflict was upstream's newPadDetachtest inGuestLibcThreads.cpp; the resolution keeps bothPadDetachandThreadHelpers(and both registrations in the extern block). The stray-brace fix from3f138a2326was absorbed into the resolution, so the second commit now only drops the unusedpthread.hinclude. Test file compiles under GCC 15.2.0.