std::mutex bug: Windows handle growth

ASSI Stromeko@nexgo.de
Sat Mar 21 20:06:58 GMT 2026


Frank Eskesen via Cygwin writes:
> I've run into a problem that occurs on Cygwin that doesn't occur on
> Linux systems: When a std::mutex is used, it doesn't clean up a
> Windows handle that it uses.

I've applied the fix provided by Corinna and built a test version on top
of the current gcc-13.4 snapshot.  Please test.

https://repo.or.cz/gcc/cygwin-gcc.git/commitdiff/f3429b7ec960fea9df62bc3c14e257d60fe436f0

The bug was already reported upstream a long time ago as FreeBSD also
has an implementation where the mutex can not be destroyed trivially:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71684

POSIX does not make such a guarantee, but there also is no feature test
macro, so it must eventually become a platform specific configuration.



Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

DIY Stuff:
http://Synth.Stromeko.net/DIY.html


More information about the Cygwin mailing list