FD.io VPP
v17.04-9-g99c0734
Vector Packet Processing
|
TW timer implementation TEMPLATE ONLY, do not compile directly. More...
Go to the source code of this file.
Functions | |
static u32 TW() | make_internal_timer_handle (u32 pool_index, u32 timer_id) |
static void | timer_addhead (TWT(tw_timer)*pool, u32 head_index, u32 new_index) |
static void | timer_remove (TWT(tw_timer)*pool, u32 index) |
u32 TW() | tw_timer_start (TWT(tw_timer_wheel)*tw, u32 pool_index, u32 timer_id, u32 interval) |
Start a Tw Timer. More... | |
void TW() | tw_timer_stop (TWT(tw_timer_wheel)*tw, u32 handle) |
Stop a tw timer. More... | |
void TW() | tw_timer_wheel_init (TWT(tw_timer_wheel)*tw, void *expired_timer_callback, f64 timer_interval_in_seconds, u32 max_expirations) |
Initialize a tw timer wheel template instance. More... | |
void TW() | tw_timer_wheel_free (TWT(tw_timer_wheel)*tw) |
Free a tw timer wheel template instance. More... | |
u32 TW() | tw_timer_expire_timers (TWT(tw_timer_wheel)*tw, f64 now) |
Advance a tw timer wheel. More... | |
TW timer implementation TEMPLATE ONLY, do not compile directly.
Definition in file tw_timer_template.c.
Advance a tw timer wheel.
Calls the expired timer callback as needed. This routine should be called once every timer_interval seconds
tw_timer_wheel_t | * tw timer wheel template instance pointer |
f64 | now the current time, e.g. from vlib_time_now(vm) |
Definition at line 239 of file tw_timer_template.c.
Start a Tw Timer.
tw_timer_wheel_t | * tw timer wheel object pointer |
u32 | pool_index user pool index, presumably for a tw session |
u32 | timer_id app-specific timer ID. 4 bits. |
u32 | interval timer interval in ticks |
Definition at line 86 of file tw_timer_template.c.
Stop a tw timer.
tw_timer_wheel_t | * tw timer wheel object pointer |
u32 | handle timer cancellation returned by tw_timer_start |
Definition at line 149 of file tw_timer_template.c.
Free a tw timer wheel template instance.
tw_timer_wheel_t | * tw timer wheel object pointer |
Definition at line 206 of file tw_timer_template.c.
void TW() tw_timer_wheel_init | ( | TWT(tw_timer_wheel)* | tw, |
void * | expired_timer_callback, | ||
f64 | timer_interval_in_seconds, | ||
u32 | max_expirations | ||
) |
Initialize a tw timer wheel template instance.
tw_timer_wheel_t | * tw timer wheel object pointer |
void | * expired_timer_callback. Passed a u32 * vector of expired timer handles. |
f64 | timer_interval_in_seconds |
Definition at line 171 of file tw_timer_template.c.