diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2021-11-22 12:33:47 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2021-11-22 12:37:12 +0100 |
commit | 24bffff63eb798d721b75b1c38c18f1687d33a2a (patch) | |
tree | c900ed0b8b217f98263cf227143797d55ebd58e7 | |
parent | d54d8f173d66c7659061de664d445458737b4a75 (diff) | |
download | newlib-24bffff63eb798d721b75b1c38c18f1687d33a2a.zip newlib-24bffff63eb798d721b75b1c38c18f1687d33a2a.tar.gz newlib-24bffff63eb798d721b75b1c38c18f1687d33a2a.tar.bz2 |
Cygwin: raise: fix check for multithreaded process
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>
-rw-r--r-- | winsup/cygwin/signal.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index bd1168e..f4b4686 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -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); } |