Remove building with NOCRYPTO option
[minix3.git] / minix / lib / libtimers / tmrs_exp.c
blob4ad4b16d12e021b7359beb23ef0717f34f388fd4
1 #include <minix/timers.h>
3 /*
4 * Use the current time to check the timers queue list for expired timers.
5 * Run the watchdog functions for all expired timers and deactivate them.
6 * The caller is responsible for scheduling a new alarm if needed.
7 */
8 int
9 tmrs_exptimers(minix_timer_t ** tmrs, clock_t now, clock_t * new_head)
11 minix_timer_t *tp;
12 tmr_func_t func;
14 while ((tp = *tmrs) != NULL && tmr_has_expired(tp, now)) {
15 *tmrs = tp->tmr_next;
17 func = tp->tmr_func;
18 tp->tmr_func = NULL;
20 (*func)(tp->tmr_arg);
23 if (*tmrs != NULL) {
24 if (new_head != NULL)
25 *new_head = (*tmrs)->tmr_exp_time;
26 return TRUE;
27 } else
28 return FALSE;