libc: the Dinkumware _Mtx_* and _Cnd_* exports are stubs; fix branch ready #3068
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 screamm on 2026-10-10T21:33:08Z.
The Dinkumware C-thread exports
_Mtx_init,_Mtx_destroy,_Mtx_lock,_Mtx_unlock,_Cnd_init,_Cnd_destroy,_Cnd_waitand_Cnd_broadcastin libc (Export.cpp) areNotImplemented_nid_no_patchstubs, so a title whose C++ runtime reachesstd::mutexorstd::condition_variablethrough libc.prx stops at its first lock.Fix branch ready:
screamm:feat/libc-dinkumware-threads(56b03751, one commit onmain262c0316). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is.core/libs/prx/libc/src/Threads.cppimplements the eight exports after microsoft/STLxthreads.h,mutex.cppandcond.cpp(commitda52dc0f): init stores null and then a heap handle and returns_Thrd_nomemon allocation failure; the other calls take the handle by value and return_Thrd_success; an owner relocking a plain or recursive mutex counts the lock, relocking any other non-recursive type returns_Thrd_busy. libc cannot call libkernel, so each handle wraps a hoststd::mutexwith owner and count, or a hoststd::condition_variable.guest_libc_threadscovers init/lock/unlock/destroy, the busy and counting relock rules, a recursive mutex excluding another thread, 4 threads × 20000 locked increments, two waiters woken by one broadcast, and every throwing case.Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build includinglibs:guest_libc_threads5/5 and 3/3 after the last change;ctest -j8 -E "^agc_|video_out"388/389, the one failure beingguest_avplayer, which passes 3/3 alone and is unrelated (it also fails under-j8load on unchangedmainhere).tools/check_conventions.py --base mainandgit diff --checkpass. Not run on Linux.Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T22:52:53Z.
Fixed by #3079: the eight Dinkumware Mtx/Cnd exports are implemented in libc, covered by
guest_libc_threads.