多线程编程指南

pthread_getschedparam 语法

int	 pthread_getschedparam(pthread_t tid, int policy,

    struct schedparam *param);
#include <pthread.h>



pthread_t tid;

sched_param param;

int priority;

int policy;

int ret;



/* scheduling parameters of target thread */

ret = pthread_getschedparam (tid, &policy, &param);



/* sched_priority contains the priority of the thread */

priority = param.sched_priority;