mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-03-02 13:05:42 +08:00
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:
parent
d54d8f173d
commit
24bffff63e
@ -301,7 +301,7 @@ extern "C" int
|
|||||||
raise (int sig)
|
raise (int sig)
|
||||||
{
|
{
|
||||||
pthread *thread = _my_tls.tid;
|
pthread *thread = _my_tls.tid;
|
||||||
if (!thread)
|
if (!thread || !__isthreaded)
|
||||||
return kill (myself->pid, sig);
|
return kill (myself->pid, sig);
|
||||||
return pthread_kill (thread, sig);
|
return pthread_kill (thread, sig);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user