From 5468173ce929429845f607e3aec85b612371a4a5 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 16 Feb 2010 19:34:42 -0800 Subject: [PATCH] [debug] Give debug_watcher maximum priority --- src/node.cc | 1 + src/node.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index 9646513..c24ecd3 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1156,6 +1156,7 @@ int main(int argc, char *argv[]) { // - which will give V8 control so it can handle whatever new message // had been received on the debug thread. ev_async_init(&node::debug_watcher, node::DebugMessageCallback); + ev_set_priority(&node::debug_watcher, EV_MAXPRI); // Set the callback DebugMessageDispatch which is called from the debug // thread. Debug::SetDebugMessageDispatchHandler(node::DebugMessageDispatch); diff --git a/src/node.js b/src/node.js index af4856b..905757c 100644 --- a/src/node.js +++ b/src/node.js @@ -351,7 +351,8 @@ var events = eventsModule.exports; var nextTickQueue = []; var nextTickWatcher = new process.IdleWatcher(); -nextTickWatcher.setPriority(process.EVMAXPRI); // max priority +// Only debugger has maximum priority. Below that is the nextTickWatcher. +nextTickWatcher.setPriority(process.EVMAXPRI-1); nextTickWatcher.callback = function () { var l = nextTickQueue.length; -- 2.7.4