X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_setschedprio.c;h=5bf4a0197e3abb9faac8b250733669126c814eab;hb=d28cd0ad428d63c186003fdf9c02470561650a04;hp=e0bdc03b8405c2f8938bbf557b933e375e9dce81;hpb=1e21e78bf7a5c24c217446d8760be7b7188711c2;p=musl diff --git a/src/thread/pthread_setschedprio.c b/src/thread/pthread_setschedprio.c index e0bdc03b..5bf4a019 100644 --- a/src/thread/pthread_setschedprio.c +++ b/src/thread/pthread_setschedprio.c @@ -1,10 +1,11 @@ #include "pthread_impl.h" +#include "lock.h" int pthread_setschedprio(pthread_t t, int prio) { int r; - __lock(t->killlock); - r = t->dead ? ESRCH : -__syscall(SYS_sched_setparam, t->tid, &prio); - __unlock(t->killlock); + LOCK(t->killlock); + r = !t->tid ? ESRCH : -__syscall(SYS_sched_setparam, t->tid, &prio); + UNLOCK(t->killlock); return r; }