From 4fd0225e41f0af9ffcee0a9f1e38ce24f2551817 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 23 Feb 2010 13:08:04 -0800 Subject: [PATCH] Give signal handlers maximum priority --- src/node_signal_handler.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/node_signal_handler.cc b/src/node_signal_handler.cc index 2cac9b179e..7a224f4c9e 100644 --- a/src/node_signal_handler.cc +++ b/src/node_signal_handler.cc @@ -56,6 +56,9 @@ Handle SignalHandler::New(const Arguments& args) { ev_signal_init(&handler->watcher_, SignalHandler::OnSignal, sig); handler->watcher_.data = handler; + // Give signal handlers very high priority. The only thing that has higher + // priority is the garbage collector check. + ev_set_priority(&handler->watcher_, EV_MAXPRI-1); ev_signal_start(EV_DEFAULT_UC_ &handler->watcher_); ev_unref(EV_DEFAULT_UC);