source: trunk/minix/lib/timers/tmrs_exp.c@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 839 bytes
RevLine 
[9]1#include "timers.h"
2
3/*===========================================================================*
4 * tmrs_exptimers *
5 *===========================================================================*/
6void tmrs_exptimers(tmrs, now, new_head)
7timer_t **tmrs; /* pointer to timers queue */
8clock_t now; /* current time */
9clock_t *new_head;
10{
11/* Use the current time to check the timers queue list for expired timers.
12 * Run the watchdog functions for all expired timers and deactivate them.
13 * The caller is responsible for scheduling a new alarm if needed.
14 */
15 timer_t *tp;
16
17 while ((tp = *tmrs) != NULL && tp->tmr_exp_time <= now) {
18 *tmrs = tp->tmr_next;
19 tp->tmr_exp_time = TMR_NEVER;
20 (*tp->tmr_func)(tp);
21 }
22
23 if(new_head) {
24 if(*tmrs)
25 *new_head = (*tmrs)->tmr_exp_time;
26 else
27 *new_head = 0;
28 }
29}
30
31
Note: See TracBrowser for help on using the repository browser.