X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_setschedparam.c;h=038d13d8acfb4cbd01aa573cd05c791fe2ef0b95;hb=b0301f47f3cf510b0237a024a3a073d55799101f;hp=8e8b5a1988d2d217616ced905f82bc08aa52a792;hpb=c6d441e3a246370d9c459396ec22b096db93850e;p=musl diff --git a/src/thread/pthread_setschedparam.c b/src/thread/pthread_setschedparam.c index 8e8b5a19..038d13d8 100644 --- a/src/thread/pthread_setschedparam.c +++ b/src/thread/pthread_setschedparam.c @@ -1,10 +1,11 @@ #include "pthread_impl.h" +#include "lock.h" int pthread_setschedparam(pthread_t t, int policy, const struct sched_param *param) { int r; - __lock(t->killlock); - r = t->dead ? ESRCH : -__syscall(SYS_sched_setscheduler, t->tid, policy, ¶m); - __unlock(t->killlock); + LOCK(t->killlock); + r = !t->tid ? ESRCH : -__syscall(SYS_sched_setscheduler, t->tid, policy, param); + UNLOCK(t->killlock); return r; }