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>
This commit is contained in:
Corinna Vinschen 2021-11-22 12:33:47 +01:00
parent d54d8f173d
commit 24bffff63e
1 changed files with 1 additions and 1 deletions

View 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);
}