-
-
Save chidumennamdi/f609642d17cb6f938c48e9c7ca91bbcf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// timer.c | |
void uv__run_timers(uv_loop_t* loop) { | |
struct heap_node* heap_node; | |
uv_timer_t* handle; | |
for (;;) { | |
heap_node = heap_min(timer_heap(loop)); | |
if (heap_node == NULL) | |
break; | |
handle = container_of(heap_node, uv_timer_t, heap_node); | |
if (handle->timeout > loop->time) | |
break; | |
uv_timer_stop(handle); | |
uv_timer_again(handle); | |
handle->timer_cb(handle); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment