From 59b584c92ddfe26430fdb4756737dd723dbee0b0 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 26 Jul 2012 13:19:14 +0200 Subject: [PATCH] node: remove PrepareTick() and CheckTick() Superfluous after commit 430d94e. Pointed out by Shigeki Ohtsu. --- src/node.cc | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/node.cc b/src/node.cc index aa8548750c..db3423c9ab 100644 --- a/src/node.cc +++ b/src/node.cc @@ -129,8 +129,6 @@ static int max_stack_size = 0; // used by C++ modules as well bool no_deprecation = false; -static uv_check_t check_tick_watcher; -static uv_prepare_t prepare_tick_watcher; static uv_idle_t tick_spinner; static bool need_tick_cb; static Persistent tick_callback_sym; @@ -263,6 +261,7 @@ static void Spin(uv_idle_t* handle, int status) { Tick(); } + static void StartTickSpinner() { need_tick_cb = true; // TODO: this tick_spinner shouldn't be necessary. An ev_prepare should be @@ -273,23 +272,12 @@ static void StartTickSpinner() { uv_idle_start(&tick_spinner, Spin); } + static Handle NeedTickCallback(const Arguments& args) { StartTickSpinner(); return Undefined(); } -static void PrepareTick(uv_prepare_t* handle, int status) { - assert(handle == &prepare_tick_watcher); - assert(status == 0); - Tick(); -} - - -static void CheckTick(uv_check_t* handle, int status) { - assert(handle == &check_tick_watcher); - assert(status == 0); - Tick(); -} static inline const char *errno_string(int errorno) { #define ERRNO_CASE(e) case e: return #e; @@ -2764,14 +2752,6 @@ char** Init(int argc, char *argv[]) { RegisterSignalHandler(SIGTERM, SignalExit); #endif // __POSIX__ - uv_prepare_init(uv_default_loop(), &prepare_tick_watcher); - uv_prepare_start(&prepare_tick_watcher, PrepareTick); - uv_unref(reinterpret_cast(&prepare_tick_watcher)); - - uv_check_init(uv_default_loop(), &check_tick_watcher); - uv_check_start(&check_tick_watcher, node::CheckTick); - uv_unref(reinterpret_cast(&check_tick_watcher)); - uv_idle_init(uv_default_loop(), &tick_spinner); uv_check_init(uv_default_loop(), &gc_check);