X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_setschedprio.c;h=fc2e13ddb3dbb74ab144c173f1b70edcee866bb2;hb=4554f155dd23a65fcdfd39f1d5af8af55ba37694;hp=dc745b42a4616adfb23a7c6e8916d740b8e500ba;hpb=c4bc0b1a64e1ef1e105df84401805a16e8dbe82a;p=musl diff --git a/src/thread/pthread_setschedprio.c b/src/thread/pthread_setschedprio.c index dc745b42..fc2e13dd 100644 --- a/src/thread/pthread_setschedprio.c +++ b/src/thread/pthread_setschedprio.c @@ -1,10 +1,14 @@ #include "pthread_impl.h" +#include "lock.h" int pthread_setschedprio(pthread_t t, int prio) { int r; + sigset_t set; + __block_app_sigs(&set); LOCK(t->killlock); - r = t->dead ? ESRCH : -__syscall(SYS_sched_setparam, t->tid, &prio); + r = !t->tid ? ESRCH : -__syscall(SYS_sched_setparam, t->tid, &prio); UNLOCK(t->killlock); + __restore_sigs(&set); return r; }