libc-top-half/musl/src/thread/pthread_setschedparam.c
raw| 1 | #include "pthread_impl.h" |
| 2 | #include "lock.h" |
| 3 | |
| 4 | int pthread_setschedparam(pthread_t t, int policy, const struct sched_param *param) |
| 5 | { |
| 6 | int r; |
| 7 | sigset_t set; |
| 8 | __block_app_sigs(&set); |
| 9 | LOCK(t->killlock); |
| 10 | r = !t->tid ? ESRCH : -__syscall(SYS_sched_setscheduler, t->tid, policy, param); |
| 11 | UNLOCK(t->killlock); |
| 12 | __restore_sigs(&set); |
| 13 | return r; |
| 14 | } |