diff --git a/docs/src/design.rst b/docs/src/design.rst index 5a20595c3..f1e9dfcb3 100644 --- a/docs/src/design.rst +++ b/docs/src/design.rst @@ -62,9 +62,6 @@ stages of a loop iteration: #. The loop concept of 'now' is initially set. -#. Due timers are run if the loop was run with ``UV_RUN_DEFAULT``. All active timers scheduled - for a time before the loop's concept of *now* get their callbacks called. - #. If the loop is *alive* an iteration is started, otherwise the loop will exit immediately. So, when is a loop considered to be *alive*? If a loop has active and ref'd handles, active requests or closing handles it's considered to be *alive*. diff --git a/docs/src/static/loop_iteration.png b/docs/src/static/loop_iteration.png index 1545f84a8..bbef46a8e 100644 Binary files a/docs/src/static/loop_iteration.png and b/docs/src/static/loop_iteration.png differ diff --git a/src/unix/core.c b/src/unix/core.c index 046503b38..ea337e111 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -411,16 +411,6 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) { if (!r) uv__update_time(loop); - /* Maintain backwards compatibility by processing timers before entering the - * while loop for UV_RUN_DEFAULT. Otherwise timers only need to be executed - * once, which should be done after polling in order to maintain proper - * execution order of the conceptual event loop. */ - if (mode == UV_RUN_DEFAULT) { - if (r) - uv__update_time(loop); - uv__run_timers(loop); - } - while (r != 0 && loop->stop_flag == 0) { can_sleep = QUEUE_EMPTY(&loop->pending_queue) && QUEUE_EMPTY(&loop->idle_handles); diff --git a/src/win/core.c b/src/win/core.c index 159bdb50e..46a55285d 100644 --- a/src/win/core.c +++ b/src/win/core.c @@ -497,16 +497,6 @@ int uv_run(uv_loop_t *loop, uv_run_mode mode) { if (!r) uv_update_time(loop); - /* Maintain backwards compatibility by processing timers before entering the - * while loop for UV_RUN_DEFAULT. Otherwise timers only need to be executed - * once, which should be done after polling in order to maintain proper - * execution order of the conceptual event loop. */ - if (mode == UV_RUN_DEFAULT) { - if (r) - uv_update_time(loop); - uv__run_timers(loop); - } - while (r != 0 && loop->stop_flag == 0) { can_sleep = loop->pending_reqs_tail == NULL && QUEUE_EMPTY(&loop->idle_handles); diff --git a/test/test-close-order.c b/test/test-close-order.c index 768e1ceed..bceacee87 100644 --- a/test/test-close-order.c +++ b/test/test-close-order.c @@ -40,7 +40,7 @@ static void close_cb(uv_handle_t* handle) { /* check_cb should run before any close_cb */ static void check_cb(uv_check_t* handle) { ASSERT(check_cb_called == 0); - ASSERT(timer_cb_called == 1); + ASSERT(timer_cb_called == 0); ASSERT(close_cb_called == 0); uv_close((uv_handle_t*) handle, close_cb); uv_close((uv_handle_t*) &timer_handle2, close_cb);