FACT++  1.0
int dtq_task ( void *  dummy)

Definition at line 307 of file dtq.c.

References alrm_sig_handler(), DIM_next_time, dim_usleep(), and get_elapsed_time().

Referenced by dim_dtq_thread(), and dim_signal_cond().

308 {
309 int deltat;
310 static int to_go;
311 
312  if(dummy){}
313  while(1)
314  {
315  if(DIM_next_time)
316  {
317  DISABLE_AST
319  if(DIM_time_left == -1)
320  DIM_time_left = 0;
321  to_go = DIM_next_time;
322  DIM_next_time = 0;
323  ENABLE_AST
324  }
325  if(DIM_time_left < 0)
326  {
327  DIM_time_left = 0;
328  alrm_sig_handler(2);
329 #ifndef WIN32
330  return(1);
331 #endif
332  }
333  else if(DIM_time_left > 0)
334  {
335  dim_usleep(100000);
336  deltat = get_elapsed_time();
337  DIM_time_left = to_go - deltat;
338  if(DIM_time_left <= 0)
339  {
340  alrm_sig_handler(2);
341 #ifndef WIN32
342  return(1);
343 #endif
344  }
345  }
346  else
347  {
348  dim_usleep(1000);
349  }
350  }
351 }
static int DIM_next_time
Definition: dtq.c:69
void dim_usleep(int usecs)
Definition: dtq.c:293
static int get_elapsed_time()
Definition: dtq.c:247
static int DIM_time_left
Definition: dtq.c:70
static void alrm_sig_handler(int num)
Definition: dtq.c:765

+ Here is the call graph for this function:

+ Here is the caller graph for this function: