22typedef struct o2s_timer
50#define O2sTimer __attribute__((cleanup(o2s_timer_delete))) o2s_timer_t
67#define ArmedTimer __attribute__((cleanup(o2s_timer_stop))) o2s_timer_t
bool o2s_timer_setup_process(void(*handle)(int, siginfo_t *, void *))
Prepare the process for timeouts.
o2s_timer_t o2s_timer_start(o2s_timer_t timer, unsigned milliseconds)
Arm timer for the specified duration, in milliseconds.
void o2s_timer_stop(o2s_timer_t *timer)
Disarm timer.
o2s_timer_t o2s_timer_create(void)
Initialize a timer, that will create a SIGALRM in the current thread when timing out.
void o2s_timer_delete(o2s_timer_t *timer)
Destructor.