Lines Matching refs:timer
336 struct net_timer* timer = NULL; in timer_thread() local
338 timer = (net_timer*)list_get_next_item(&sTimers, timer); in timer_thread()
339 if (timer == NULL) in timer_thread()
342 if (timer->due < system_time()) { in timer_thread()
344 list_remove_item(&sTimers, timer); in timer_thread()
345 timer->due = -1; in timer_thread()
346 sCurrentTimer = timer; in timer_thread()
349 timer->hook(timer, timer->data); in timer_thread()
355 timer = NULL; in timer_thread()
359 if (timer->due < timeout) in timer_thread()
360 timeout = timer->due; in timer_thread()
386 init_timer(net_timer* timer, net_timer_func hook, void* data) in init_timer() argument
388 timer->hook = hook; in init_timer()
389 timer->data = data; in init_timer()
390 timer->due = 0; in init_timer()
391 timer->flags = 0; in init_timer()
404 set_timer(net_timer* timer, bigtime_t delay) in set_timer() argument
408 TRACE("set_timer %p, hook %p, data %p\n", timer, timer->hook, timer->data); in set_timer()
410 if (timer->due > 0 && delay < 0) { in set_timer()
412 list_remove_item(&sTimers, timer); in set_timer()
413 timer->due = 0; in set_timer()
418 if (timer->due <= 0) in set_timer()
419 list_add_item(&sTimers, timer); in set_timer()
421 timer->due = system_time() + delay; in set_timer()
424 if (sTimerTimeout > timer->due) in set_timer()
431 cancel_timer(struct net_timer* timer) in cancel_timer() argument
435 TRACE("cancel_timer %p, hook %p, data %p\n", timer, timer->hook, in cancel_timer()
436 timer->data); in cancel_timer()
438 if (timer->due <= 0) in cancel_timer()
442 list_remove_item(&sTimers, timer); in cancel_timer()
443 timer->due = 0; in cancel_timer()
449 wait_for_timer(struct net_timer* timer) in wait_for_timer() argument
459 if (timer->due <= 0 && sCurrentTimer != timer) in wait_for_timer()
476 is_timer_active(net_timer* timer) in is_timer_active() argument
478 return timer->due > 0; in is_timer_active()
483 is_timer_running(net_timer* timer) in is_timer_running() argument
485 return timer == sCurrentTimer; in is_timer_running()
494 struct net_timer* timer = NULL; in dump_timer() local
496 timer = (net_timer*)list_get_next_item(&sTimers, timer); in dump_timer()
497 if (timer == NULL) in dump_timer()
500 kprintf("%p %p %p %" B_PRId64 "\n", timer, timer->hook, timer->data, in dump_timer()
501 timer->due > 0 ? timer->due - system_time() : -1); in dump_timer()