Lines Matching refs:alarms
67 static list_t *alarms; variable
86 if (!alarms && !lazy_initialize()) in alarm_new()
152 assert(alarms != NULL); in alarm_set_internal()
170 assert(alarms != NULL); in alarm_cancel()
175 bool needs_reschedule = (!list_is_empty(alarms) && list_front(alarms) == alarm); in alarm_cancel()
177 list_remove(alarms, alarm); in alarm_cancel()
194 if (!alarms) in alarm_cleanup()
205 list_free(alarms); in alarm_cleanup()
206 alarms = NULL; in alarm_cleanup()
212 assert(alarms == NULL); in lazy_initialize()
216 alarms = list_new(NULL); in lazy_initialize()
217 if (!alarms) { in lazy_initialize()
249 assert(alarms != NULL); in now()
264 bool needs_reschedule = (!list_is_empty(alarms) && list_front(alarms) == alarm); in schedule_next_instance()
266 list_remove(alarms, alarm); in schedule_next_instance()
274 if (list_is_empty(alarms) || ((alarm_t *)list_front(alarms))->deadline >= alarm->deadline) in schedule_next_instance()
275 list_prepend(alarms, alarm); in schedule_next_instance()
277 for (list_node_t *node = list_begin(alarms); node != list_end(alarms); node = list_next(node)) { in schedule_next_instance()
279 if (next == list_end(alarms) || ((alarm_t *)list_node(next))->deadline >= alarm->deadline) { in schedule_next_instance()
280 list_insert_after(alarms, node, alarm); in schedule_next_instance()
286 …if (force_reschedule || needs_reschedule || (!list_is_empty(alarms) && list_front(alarms) == alarm… in schedule_next_instance()
293 assert(alarms != NULL); in reschedule_root_alarm()
299 if (list_is_empty(alarms)) in reschedule_root_alarm()
302 alarm_t *next = list_front(alarms); in reschedule_root_alarm()
368 if (list_is_empty(alarms) || (alarm = list_front(alarms))->deadline > now()) { in callback_dispatch()
374 list_remove(alarms, alarm); in callback_dispatch()