sched_param结构未定义?
我想设置线程优先级,程序如下:
#include <pthread.h>
#include <sched.h>
pthread_attr_t tha; /* thread attributes */
sched_param param;
int newprio=60;
res = pthread_attr_init(&tha);
pthread_attr_getschedparam(&tha, param);
param.sched_priority=newprio;
pthread_attr_setschedparam(&tha, param);
在linux下编译时出错,提示`sched_param' undeclared (first use in this function),请高手指教~!!!