std::mutex bug: Windows handle growth
Corinna Vinschen
corinna-cygwin@cygwin.com
Mon Mar 23 10:24:37 GMT 2026
Hi Achim,
On Mar 21 21:06, ASSI via Cygwin wrote:
> 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
Reading this bug report, wouldn't just defining
_GTHREAD_USE_MUTEX_INIT_FUNC for Cygwin have the same effect?
Thanks,
Corinna
More information about the Cygwin
mailing list