65 struct sched_param schedparam;
67 pthread_getschedparam(
_threadID, &schedpolicy, &schedparam);
70 schedparam.sched_priority = priority;
71 pthread_setschedparam(
_threadID, schedpolicy, &schedparam);
125 pthread_attr_t newThreadAttr;
126 int schedpolicy, maxpri, minpri;
127 struct sched_param schedparam;
130 pthread_attr_init(&newThreadAttr);
131 #if defined(LINUX) || defined(OPSYS_SUN) || defined(AIX)
134 pthread_getschedparam(pthread_self(), &schedpolicy, &schedparam);
140 schedparam.sched_priority = 59;
142 # ifdef _POSIX_PRIORITY_SCHEDULING
143 maxpri = sched_get_priority_max(schedpolicy);
144 minpri = sched_get_priority_min(schedpolicy);
145 schedparam.sched_priority = (minpri + maxpri) / 2;
149 #if defined(OPSYS_SUN)
151 pthread_attr_setinheritsched(&newThreadAttr, PTHREAD_EXPLICIT_SCHED);
155 pthread_attr_setschedpolicy(&newThreadAttr, SCHED_RR);
160 pthread_attr_setinheritsched(&newThreadAttr, PTHREAD_EXPLICIT_SCHED);
166 pthread_attr_setschedpolicy(&newThreadAttr, SCHED_OTHER);
169 pthread_attr_setschedparam(&newThreadAttr, &schedparam);
180 fprintf(stderr,
" *** ERROR: At SysThread(), createThread - RC = %d !\n", rc);
182 pthread_attr_destroy(&newThreadAttr);
virtual void attachThread()
void setPriority(int priority)
bool equals(SysThread &other)
static void * call_thread_function(void *argument)