X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_kill.c;h=3d9395cb7e0a0b5797c962e4af2d22d95de93718;hb=7b384c42b73ca1a1e150b3f255990ec53cedec60;hp=17aa5c4bdba2dd2af3d7a2368e72b5c8e9b132ea;hpb=be82e122bf37fdcd1766d1ed220f0300b30ab6a3;p=musl diff --git a/src/thread/pthread_kill.c b/src/thread/pthread_kill.c index 17aa5c4b..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(__NR_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; }