X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_setschedprio.c;h=5bf4a0197e3abb9faac8b250733669126c814eab;hb=8ed2bd8bfcb4ea6448afb55a941f4b5b2b0398c0;hp=e0bdc03b8405c2f8938bbf557b933e375e9dce81;hpb=c6d441e3a246370d9c459396ec22b096db93850e;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; }