On Sunday 04 October 2026 12:43:55 Peter0x44 wrote: > On 2026-10-04 12:21, Pali Rohár wrote: > > Hello, > > > > msvc already provides C11 threads.h support via its own header file and > > runtime library vcruntime140_threads.dll (available for x86, amd64 and > > arm64; but not for arm32). This library is part of the Visual C++ 2022 > > redistributable package version 14.38.32919.0. > > > > I have prepared mingw-w64 import libraries and compatible threads.h > > include file for the C11 threads support, with the msvc runtime. > > They can be easily used with the gcc -mcrtdll= command line option. > > > > I'm attaching mingw-w64 changes. Kirill run CI testing: > > https://github.com/maiddaisuki/mingw-w64/actions/runs/37173717081 > > > > Do you think it could be usable for mingw-w64? We already have import > > libraries from the Visual C++ redistributable package (like all > > versioned msvcr* libs), and right now there is no threads.h support in > > mingw-w64 yet. > > > > I think that for future, mingw-w64 could provide own implementations of > > C11 threads.h functions (for static linking) compatible with the msvc > > runtime functions. I have checked if there is a wine implementation or > > documentation, but wine project has not documented this yet. > > > > Pali > > Skeeto has created a small implementation of c11 threads for w64devkit. > https://nullprogram.com/blog/2026/09/20/ > He discusses it on his blog here. > > https://github.com/skeeto/w64devkit/blob/master/src/threads.c
Interesting... I quickly checked the source code and seems that it has the same deadlock issue (when called from DllMain) in thrd_create as LIU Hao found in my _beginthreadex implementation which I sent to the list recently. I'm planning to send a new/different implementation to address that deadlock. Do you know if there is some description of the MS ABI for mtx_t, cnd_t, tss_t and once_flag? This would really useful for providing ABI compatible implementation. _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
