]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: pthread: Fix a race issue introduced by the commit 2c5433e5da82
authorTakashi Yano <takashi.yano@nifty.ne.jp>
Wed, 29 May 2024 10:12:09 +0000 (19:12 +0900)
committerTakashi Yano <takashi.yano@nifty.ne.jp>
Sun, 2 Jun 2024 14:18:29 +0000 (23:18 +0900)
commit5a859642f0dc4fb10926fd0cdd2025248a9e18ea
tree413b045b296e766fc5a246f3e7c8d31024509f0e
parentabfa508e727b5547a0c0624229546dd068b12ad1
Cygwin: pthread: Fix a race issue introduced by the commit 2c5433e5da82

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 discussing how to fix this.

Addresses: https://cygwin.com/pipermail/cygwin/2024-May/255987.html
Reported-by: Bruno Haible <bruno@clisp.org>
Fixes: 2c5433e5da82 ("Cygwin: pthread: Fix handle leak in pthread_once.")
Reviewed-by: Ken Brown <kbrown@cornell.edu>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
winsup/cygwin/local_includes/thread.h
winsup/cygwin/release/3.5.4
winsup/cygwin/thread.cc
This page took 0.025748 seconds and 5 git commands to generate.