X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_kill.c;h=6d70e626daf40bdf8e60240fc1fbb1b561d377dd;hb=40bae2d32fd6f3ffea437fa745ad38a1fe77b27e;hp=d9a5096a06751781cc3c5d6ac5c923b7cc78d500;hpb=bbbe87e35cfeef593e23010e35528e722027567f;p=musl diff --git a/src/thread/pthread_kill.c b/src/thread/pthread_kill.c index d9a5096a..6d70e626 100644 --- a/src/thread/pthread_kill.c +++ b/src/thread/pthread_kill.c @@ -3,8 +3,9 @@ int pthread_kill(pthread_t t, int sig) { int r; - __lock(t->killlock); - r = t->dead ? ESRCH : -__syscall(SYS_tgkill, t->pid, t->tid, sig); - __unlock(t->killlock); + LOCK(t->killlock); + r = t->tid ? -__syscall(SYS_tkill, t->tid, sig) + : (sig+0U >= _NSIG ? EINVAL : 0); + UNLOCK(t->killlock); return r; }