Skip to content

Instantly share code, notes, and snippets.

@deepal
Last active January 15, 2020 14:27
Show Gist options
  • Save deepal/96776b771e6dc5c2e9bbcbcef1a62e0a to your computer and use it in GitHub Desktop.
Save deepal/96776b771e6dc5c2e9bbcbcef1a62e0a to your computer and use it in GitHub Desktop.
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__run_pending(loop);
uv__run_idle(loop);
uv__run_prepare(loop);
timeout = 0;
if ((mode == UV_RUN_ONCE && !ran_pending) || mode == UV_RUN_DEFAULT)
timeout = uv_backend_timeout(loop);
uv__io_poll(loop, timeout);
uv__run_check(loop);
uv__run_closing_handles(loop);
if (mode == UV_RUN_ONCE) {
uv__update_time(loop);
uv__run_timers(loop);
}
r = uv__loop_alive(loop);
if (mode == UV_RUN_ONCE || mode == UV_RUN_NOWAIT)
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment