]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: thread: Reset _my_tls.tid if it's pthread_null in init_mainthread().
authorTakashi Yano <takashi.yano@nifty.ne.jp>
Thu, 22 Jun 2023 15:07:26 +0000 (00:07 +0900)
committerTakashi Yano <takashi.yano@nifty.ne.jp>
Tue, 27 Jun 2023 13:10:43 +0000 (22:10 +0900)
commitbfb16b0edef49b8e694bcb1b419bfcb5a0a3dfac
tree400eb2f5ca0a35778f0e2cbf5f3be3fa594bce1e
parent4c7d0dfec5793cbf5cf3930b91f930479126d8ce
Cygwin: thread: Reset _my_tls.tid if it's pthread_null in init_mainthread().

Currently, _my_tls.tid is set to pthread_null if pthread::self()
is called before pthread::init_mainthread(). As a result, pthread::
init_mainthread() does not set _my_tls.tid appropriately. Due to
this, pthread_join() fails in LDAP environment if the program is
the first program which loads cygwin1.dll.

https://cygwin.com/pipermail/cygwin/2023-June/253792.html

With this patch, _my_tls.tid is re-initialized in pthread::
init_mainthread() if it is pthread_null.

Reported-by: Mümin A. <muminaydin06@gmail.com>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
winsup/cygwin/thread.cc
This page took 0.029797 seconds and 5 git commands to generate.