X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_kill.c;h=d9a5096a06751781cc3c5d6ac5c923b7cc78d500;hb=4d98280388a21db6913911ff647b2e56338d46cf;hp=6448d978d1257a0f3fd07a4454b116317b26015e;hpb=685e40bb09f5f24a2af54ea09c97328808f76990;p=musl diff --git a/src/thread/pthread_kill.c b/src/thread/pthread_kill.c index 6448d978..d9a5096a 100644 --- a/src/thread/pthread_kill.c +++ b/src/thread/pthread_kill.c @@ -2,5 +2,9 @@ int pthread_kill(pthread_t t, int sig) { - return __syscall(__NR_tgkill, t->pid, t->tid, sig); + int r; + __lock(t->killlock); + r = t->dead ? ESRCH : -__syscall(SYS_tgkill, t->pid, t->tid, sig); + __unlock(t->killlock); + return r; }