X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fthread%2Fpthread_kill.c;h=a24ecc20576f846dd64a4e7ae707b3d8d5148cc3;hp=9d85fa5b497fb06afcabf9d1258cc8e446b3dabd;hb=7779dbd2663269b465951189b4f43e70839bc073;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01 diff --git a/src/thread/pthread_kill.c b/src/thread/pthread_kill.c index 9d85fa5b..a24ecc20 100644 --- a/src/thread/pthread_kill.c +++ b/src/thread/pthread_kill.c @@ -1,7 +1,10 @@ -#define SYSCALL_RETURN_ERRNO #include "pthread_impl.h" int pthread_kill(pthread_t t, int sig) { - return syscall3(__NR_tgkill, t->pid, t->tid, sig); + int r; + __lock(&t->killlock); + r = t->dead ? ESRCH : -__syscall(SYS_tgkill, t->pid, t->tid, sig); + a_store(&t->killlock, 0); + return r; }