[PATCH] Cygwin: pthread: Fix a race issue introduced by the commit 2c5433e5da82

2024-05-29 Thread Takashi Yano
To avoid race issues, pthread::once() uses pthread_mutex. This caused the handle leak which was fixed by the commit 2c5433e5da82. However, this fix introduced another race issue, i.e., the mutex may be used after it is destroyed. With this patch, do not use pthread_mutex in pthread::once() to avoid

Re: [PATCH] Cygwin: pthread: Fix a race issue introduced by the commit 2c5433e5da82

2024-05-29 Thread Takashi Yano
On Wed, 29 May 2024 13:17:47 +0200 Bruno Haible wrote: > Takashi Yano wrote: > > To avoid race issues, pthread::once() uses pthread_mutex. This caused > > the handle leak which was fixed by the commit 2c5433e5da82. However, > > this fix introduced another race issue, i.e., the mutex may be used > >

[PATCH v2] Cygwin: pthread: Fix a race issue introduced by the commit 2c5433e5da82

2024-05-29 Thread Takashi Yano
To avoid race issues, pthread::once() uses pthread_mutex. This caused the handle leak which was fixed by the commit 2c5433e5da82. However, this fix introduced another race issue, i.e., the mutex may be used after it is destroyed. This patch fixes the issue. Special thanks to Bruno Haible for discus