00001 #ifndef _ddekit_timer_h 00002 #define _ddekit_timer_h 00003 00004 #include <l4/dde/ddekit/thread.h> 00005 00006 enum 00007 { 00008 DDEKIT_INVALID_TIMER_ID = -1, 00009 }; 00010 00011 /** \defgroup DDEKit_timer 00012 * 00013 * Timer subsystem 00014 * 00015 * DDEKit provides a generic timer implementation that enables users 00016 * to execute a function with some arguments after a certain period 00017 * of time. DDEKit therefore starts a timer thread that executes these 00018 * functions and keeps track of the currently running timers. 00019 */ 00020 00021 /** Add a timer event. After the absolute timeout has expired, function fn 00022 * is called with args as arguments. 00023 * 00024 * \ingroup DDEKit_timer 00025 * 00026 * \return >=0 valid timer ID 00027 * \return < 0 error 00028 */ 00029 int ddekit_add_timer(void (*fn)(void *), void *args, unsigned long timeout); 00030 00031 /** Delete timer with the corresponding timer id. 00032 * 00033 * \ingroup DDEKit_timer 00034 */ 00035 int ddekit_del_timer(int timer); 00036 00037 /** Check whether a timer is pending 00038 * 00039 * \ingroup DDEKit_timer 00040 * 00041 * Linux needs this. 00042 */ 00043 int ddekit_timer_pending(int timer); 00044 00045 /** Initialization function, startup timer thread 00046 * 00047 * \ingroup DDEKit_timer 00048 */ 00049 void ddekit_init_timers(void); 00050 00051 /** Get the timer thread. 00052 */ 00053 ddekit_thread_t *ddekit_get_timer_thread(void); 00054 00055 #endif
1.5.6