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


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to