blob: 1931afa9fdb9f3e8e10c16ad48b6e16b519978e1 (
plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#ifndef _DDEKIT_TIMER_H
#define _DDEKIT_TIMER_H
#include <ddekit/ddekit.h>
#include <ddekit/thread.h>
/** \defgroup DDEKit_timer
*
* Timer subsystem
*
* DDEKit provides a generic timer implementation that enables users
* to execute a function with some arguments after a certain period
* of time. DDEKit therefore starts a timer thread that executes these
* functions and keeps track of the currently running timers.
*/
/** Add a timer event. After the absolute timeout has expired, function fn
* is called with args as arguments.
*
* \ingroup DDEKit_timer
*
* \return >=0 valid timer ID
* \return < 0 error
*/
int ddekit_add_timer(void (*fn)(void *), void *args, unsigned long
timeout);
/** Delete timer with the corresponding timer id.
*
* \ingroup DDEKit_timer
*/
int ddekit_del_timer(int timer);
/** Check whether a timer is pending
*
* \ingroup DDEKit_timer
*
* Linux needs this.
*/
int ddekit_timer_pending(int timer);
/** Initialization function, startup timer thread
*
* \ingroup DDEKit_timer
*/
void ddekit_init_timers(void);
/** Get the timer thread.
*/
ddekit_thread_t *ddekit_get_timer_thread(void);
#endif
|