Cygwin: raise: change to call pthread_kill

POSIX requires that raise(3) is equivalent to

  pthread_kill(pthread_self(), sig);

in multi-threaded applications.  Our raise just called kill(sig).
Fix that.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-01-30 11:36:45 +01:00
parent 4d738e0f62
commit a52396bd07
2 changed files with 7 additions and 1 deletions

View File

@@ -300,7 +300,10 @@ _pinfo::kill (siginfo_t& si)
extern "C" int
raise (int sig)
{
return kill (myself->pid, sig);
pthread *thread = _my_tls.tid;
if (!thread)
return kill (myself->pid, sig);
return pthread_kill (thread, sig);
}
static int