The priority is one of the parameters for the scheduler.
You can change the parameters dynamically using the API below.
int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param *param)
You can also get the parameter using the following API:
int pthread_attr_getschedparam(pthread_attr_t* attr, struct sched_param* schedpar)