-
Notifications
You must be signed in to change notification settings - Fork 200
/
Copy pathtimer.h
34 lines (30 loc) · 788 Bytes
/
timer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* timer.h
*
* Deadline-based timer callbacks.
*
* Written & released by Keir Fraser <[email protected]>
*
* This is free and unencumbered software released into the public domain.
* See the file COPYING for more details, or visit <http://unlicense.org>.
*/
struct timer {
time_t deadline;
void (*cb_fn)(void *);
void *cb_dat;
struct timer *next;
};
/* Safe to call from any priority level same or lower than TIMER_IRQ_PRI. */
void timer_init(struct timer *timer, void (*cb_fn)(void *), void *cb_dat);
void timer_set(struct timer *timer, time_t deadline);
void timer_cancel(struct timer *timer);
void timers_init(void);
/*
* Local variables:
* mode: C
* c-file-style: "Linux"
* c-basic-offset: 4
* tab-width: 4
* indent-tabs-mode: nil
* End:
*/