Browse Source

Give signal handlers maximum priority

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
4fd0225e41
  1. 3
      src/node_signal_handler.cc

3
src/node_signal_handler.cc

@ -56,6 +56,9 @@ Handle<Value> SignalHandler::New(const Arguments& args) {
ev_signal_init(&handler->watcher_, SignalHandler::OnSignal, sig); ev_signal_init(&handler->watcher_, SignalHandler::OnSignal, sig);
handler->watcher_.data = handler; 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_signal_start(EV_DEFAULT_UC_ &handler->watcher_);
ev_unref(EV_DEFAULT_UC); ev_unref(EV_DEFAULT_UC);

Loading…
Cancel
Save