FACT++  1.0
int dim_set_scheduler_class ( int  pclass)

Definition at line 247 of file dim_thr_old.c.

References ALRM_thread, IO_thread, and MAIN_thread.

Referenced by dim_signal_cond().

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

+ Here is the caller graph for this function: