1 #include "pthread_impl.h"
2 #include "lock.h"
3 #ifndef __LITEOS__
4 #include "param_check.h"
5 #endif
6
pthread_setschedparam(pthread_t t, int policy, const struct sched_param *param)7 int pthread_setschedparam(pthread_t t, int policy, const struct sched_param *param)
8 {
9 int r;
10 sigset_t set;
11 #ifndef __LITEOS__
12 PARAM_CHECK(t);
13 #endif
14 __block_app_sigs(&set);
15 LOCK(t->killlock);
16 #ifdef __LITEOS_A__
17 r = !t->tid ? ESRCH : -__syscall(SYS_sched_setscheduler, t->tid, policy, param, MUSL_TYPE_THREAD);
18 #else
19 r = !t->tid ? ESRCH : -__syscall(SYS_sched_setscheduler, t->tid, policy, param);
20 #endif
21 UNLOCK(t->killlock);
22 __restore_sigs(&set);
23 return r;
24 }
25