]> granicus.if.org Git - libevent/commitdiff
Put internal events at highest priority
authorNick Mathewson <nickm@torproject.org>
Fri, 17 Sep 2010 04:24:50 +0000 (00:24 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 17 Sep 2010 04:24:50 +0000 (00:24 -0400)
(If we allow user events to starve internal events, then internal events
never actually happen, signals don't get acked, etc)

event.c
signal.c

diff --git a/event.c b/event.c
index a1cc9c18987bbd71e9064b627ad42c8c71da6868..bf6e3ba08e4b5c76d112d942d4019a4ed5116721 100644 (file)
--- a/event.c
+++ b/event.c
@@ -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);
 }
index 4e70c9d9faeb11122231fe10878f205f62b04610..86361cce6c86105ef6c10428fc7b1479d9c4a22c 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -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;