X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_setschedprio.c;h=c353f6b53942dc9d21066aba5948d83bb3d89b58;hb=d5e55ba3320c30310ca1d8938925d5424a652422;hp=e0bdc03b8405c2f8938bbf557b933e375e9dce81;hpb=c6d441e3a246370d9c459396ec22b096db93850e;p=musl diff --git a/src/thread/pthread_setschedprio.c b/src/thread/pthread_setschedprio.c index e0bdc03b..c353f6b5 100644 --- a/src/thread/pthread_setschedprio.c +++ b/src/thread/pthread_setschedprio.c @@ -3,8 +3,8 @@ 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; }