Put internal events at highest priority

(If we allow user events to starve internal events, then internal events
never actually happen, signals don't get acked, etc)
This commit is contained in:
Nick Mathewson 2010-09-17 00:24:50 -04:00
parent 040a019f52
commit 90651b327a
2 changed files with 2 additions and 0 deletions

View File

@ -2720,6 +2720,7 @@ evthread_make_base_notifiable(struct event_base *base)
/* we need to mark this as internal event */
base->th_notify.ev_flags |= EVLIST_INTERNAL;
event_priority_set(&base->th_notify, 0);
return event_add(&base->th_notify, NULL);
}

View File

@ -136,6 +136,7 @@ evsig_init(struct event_base *base)
EV_READ | EV_PERSIST, evsig_cb, &base->sig.ev_signal);
base->sig.ev_signal.ev_flags |= EVLIST_INTERNAL;
event_priority_set(&base->sig.ev_signal, 0);
base->evsigsel = &evsigops;
base->evsigbase = &base->sig;