FACT++  1.0
int dim_set_scheduler_class ( int  pclass)

Definition at line 255 of file dim_thr.c.

References ALRM_thread, IO_thread, and MAIN_thread.

Referenced by dim_signal_cond().

256 {
257 #ifdef __linux__
258  int ret, prio, p;
259  struct sched_param param;
260 
261  if(pclass == 0)
262  {
263  pclass = SCHED_OTHER;
264  }
265  else if(pclass == 1)
266  {
267  pclass = SCHED_FIFO;
268  }
269  else if(pclass == 2)
270  {
271  pclass = SCHED_RR;
272  }
273  prio = sched_get_priority_min(pclass);
274  ret = pthread_getschedparam(MAIN_thread, &p, &param);
275  if( (p == SCHED_OTHER) || (pclass == SCHED_OTHER) )
276  param.sched_priority = prio;
277  ret = pthread_setschedparam(MAIN_thread, pclass, &param);
278  if(ret)
279  return 0;
280  ret = pthread_getschedparam(IO_thread, &p, &param);
281  if( (p == SCHED_OTHER) || (pclass == SCHED_OTHER) )
282  param.sched_priority = prio;
283  ret = pthread_setschedparam(IO_thread, pclass, &param);
284  if(ret)
285  return 0;
286  ret = pthread_getschedparam(ALRM_thread, &p, &param);
287  if( (p == SCHED_OTHER) || (pclass == SCHED_OTHER) )
288  param.sched_priority = prio;
289  ret = pthread_setschedparam(ALRM_thread, pclass, &param);
290  if(!ret)
291  return 1;
292 #endif
293  return 0;
294 }
pthread_t IO_thread
Definition: dim_thr.c:18
pthread_t MAIN_thread
Definition: dim_thr.c:21
pthread_t ALRM_thread
Definition: dim_thr.c:19

+ Here is the caller graph for this function: