X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_kill.c;h=3d9395cb7e0a0b5797c962e4af2d22d95de93718;hb=4fd0f2056082441a4503f6bfcb787a7c15754518;hp=36e9b6da1f081f1bea5cdbf8ea1d822fa55b2a9c;hpb=c2cd25bff89c3581780e7eb267262cb8c4da0d38;p=musl diff --git a/src/thread/pthread_kill.c b/src/thread/pthread_kill.c index 36e9b6da..3d9395cb 100644 --- a/src/thread/pthread_kill.c +++ b/src/thread/pthread_kill.c @@ -1,6 +1,12 @@ #include "pthread_impl.h" +#include "lock.h" int pthread_kill(pthread_t t, int sig) { - return -__syscall(SYS_tgkill, t->pid, t->tid, sig); + int r; + LOCK(t->killlock); + r = t->tid ? -__syscall(SYS_tkill, t->tid, sig) + : (sig+0U >= _NSIG ? EINVAL : 0); + UNLOCK(t->killlock); + return r; }