]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: raise: fix check for multithreaded process
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 22 Nov 2021 11:33:47 +0000 (12:33 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 22 Nov 2021 11:37:12 +0000 (12:37 +0100)
The check for the pthread self pointer in TLS is misleading,
given the main thread has this pointer initialized as well.
Check for the global __isthreaded flag as well.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/signal.cc

index bd1168e907cd152bd940a506bc2677b4e095fd23..f4b4686643ae0bf9ac59ed9f4ac9da60ee616bba 100644 (file)
@@ -301,7 +301,7 @@ extern "C" int
 raise (int sig)
 {
   pthread *thread = _my_tls.tid;
-  if (!thread)
+  if (!thread || !__isthreaded)
     return kill (myself->pid, sig);
   return pthread_kill (thread, sig);
 }
This page took 0.032704 seconds and 5 git commands to generate.