1 #include "pthread_impl.h" 2 pthread_attr_setschedparam(pthread_attr_t * restrict a,const struct sched_param * restrict param)3int pthread_attr_setschedparam(pthread_attr_t *restrict a, const struct sched_param *restrict param) 4 { 5 #ifdef __LITEOS_A__ 6 if ((a->_a_policy == SCHED_RR || a->_a_policy == SCHED_FIFO) && 7 (param->sched_priority < 0 || param->sched_priority > PTHREAD_PRIORITY_LOWEST)) { 8 return EINVAL; 9 } 10 a->_a_deadline = param->sched_deadline; 11 a->_a_period = param->sched_period; 12 #endif 13 a->_a_prio = param->sched_priority; 14 return 0; 15 } 16