libosmocore 0.9.6-23.20170220git32ee5af8.fc42
Osmocom core library
Loading...
Searching...
No Matches
osmo_timer_list Struct Reference

A structure representing a single instance of a timer. More...

#include <timer.h>

Data Fields

struct rb_node node
 rb-tree node header
 
struct llist_head list
 internal list header
 
struct timeval timeout
 expiration time
 
unsigned int active: 1
 is it active?
 
void(* cb )(void *)
 call-back called at timeout
 
void * data
 user data for callback
 

Detailed Description

A structure representing a single instance of a timer.

Timer management:

  • Create a struct osmo_timer_list
  • Fill out timeout and use add_timer or use osmo_timer_schedule to schedule a timer in x seconds and microseconds from now...
  • Use osmo_timer_del to remove the timer

Internally:

  • We hook into select.c to give a timeval of the nearest timer. On already passed timers we give it a 0 to immediately fire after the select
  • osmo_timers_update will call the callbacks and remove the timers.

The documentation for this struct was generated from the following file: