-
-
Save chidumennamdi/ecee6a0e065aca5fa1bc5f3909965142 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
// win/core.c | |
int uv_run(uv_loop_t *loop, uv_run_mode mode) { | |
DWORD timeout; | |
int r; | |
int ran_pending; | |
r = uv__loop_alive(loop); | |
if (!r) | |
uv_update_time(loop); | |
while (r != 0 && loop->stop_flag == 0) { | |
uv_update_time(loop); | |
uv__run_timers(loop); | |
ran_pending = uv_process_reqs(loop); | |
uv_idle_invoke(loop); | |
uv_prepare_invoke(loop); | |
timeout = 0; | |
if ((mode == UV_RUN_ONCE && !ran_pending) || mode == UV_RUN_DEFAULT) | |
timeout = uv_backend_timeout(loop); | |
uv__poll(loop, timeout); | |
uv_check_invoke(loop); | |
uv_process_endgames(loop); | |
if (mode == UV_RUN_ONCE) { | |
uv__run_timers(loop); | |
} | |
r = uv__loop_alive(loop); | |
if (mode == UV_RUN_ONCE || mode == UV_RUN_NOWAIT) | |
break; | |
} | |
if (loop->stop_flag != 0) | |
loop->stop_flag = 0; | |
return r; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment