35#include <osmocom/core/linuxrbtree.h>
77 const struct timeval *now,
78 struct timeval *remaining);
94extern struct timeval osmo_gettimeofday_override_time;
int osmo_timer_remaining(const struct osmo_timer_list *timer, const struct timeval *now, struct timeval *remaining)
compute the remaining time of a timer
Definition timer.c:139
int osmo_timer_pending(struct osmo_timer_list *timer)
check if given timer is still pending
Definition timer.c:125
void osmo_timer_del(struct osmo_timer_list *timer)
delete a timer from timer management
Definition timer.c:107
void osmo_timers_prepare(void)
Find the nearest time and update nearest_p.
Definition timer.c:191
struct timeval * osmo_timers_nearest(void)
Determine time between now and the nearest timer.
Definition timer.c:166
int osmo_gettimeofday(struct timeval *tv, struct timezone *tz)
shim around gettimeofday to be able to set the time manually. To override, set osmo_gettimeofday_over...
Definition timer_gettimeofday.c:39
void osmo_timer_add(struct osmo_timer_list *timer)
add a new timer to the timer management
Definition timer.c:71
void osmo_timer_schedule(struct osmo_timer_list *timer, int seconds, int microseconds)
schedule a timer at a given future relative time
Definition timer.c:90
bool osmo_gettimeofday_override
Definition timer_gettimeofday.c:33
int osmo_timers_check(void)
Check how many timers we have in the system.
Definition timer.c:255
int osmo_timers_update(void)
fire all timers... and remove them
Definition timer.c:209
void osmo_gettimeofday_override_add(time_t secs, suseconds_t usecs)
convenience function to advance the fake time. Add the given values to osmo_gettimeofday_override_tim...
Definition timer_gettimeofday.c:51
Simple doubly linked list implementation.
(double) linked list header structure
Definition linuxlist.h:47
A structure representing a single instance of a timer.
Definition timer.h:54
struct llist_head list
internal list header
Definition timer.h:56
unsigned int active
is it active?
Definition timer.h:58
struct rb_node node
rb-tree node header
Definition timer.h:55
void(* cb)(void *)
call-back called at timeout
Definition timer.h:60
void * data
user data for callback
Definition timer.h:61
struct timeval timeout
expiration time
Definition timer.h:57
Definition linuxrbtree.h:100