Browse Source

Listeners use libevent's "event_active_later()"

Steven Engler 2 years ago
parent
commit
7aac361ea4
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/lib/evloop/events.c

+ 6 - 3
src/lib/evloop/events.c

@@ -9,6 +9,9 @@
 #include <event2/event.h>
 #include <string.h>
 
+/* An unsupported libevent function. */
+void event_active_later_(struct event *, int);
+
 /* How a subscribed listener wants to receive an event. */
 typedef struct event_subscription_t {
   event_listener_t *listener;
@@ -346,7 +349,7 @@ event_listener_receive(event_listener_t *listener, event_label_t label,
   if (!listener->is_pending && notify) {
     listener->is_pending = true;
     if (listener->eventloop_ev != NULL) {
-      event_active(listener->eventloop_ev, EV_READ, 1);
+      event_active_later_(listener->eventloop_ev, EV_READ);
     }
   }
 
@@ -363,7 +366,7 @@ event_listener_wakeup(event_listener_t *listener)
     // not pending but have waiting events
     listener->is_pending = true;
     if (listener->eventloop_ev != NULL) {
-      event_active(listener->eventloop_ev, EV_READ, 1);
+      event_active_later_(listener->eventloop_ev, EV_READ);
     }
   }
 
@@ -417,7 +420,7 @@ event_listener_process(event_listener_t *listener)
   if (TOR_TAILQ_EMPTY(&listener->pending_events)) {
     listener->is_pending = false;
   } else {
-    event_active(listener->eventloop_ev, EV_READ, 1);
+    event_active_later_(listener->eventloop_ev, EV_READ);
   }
 
   tor_mutex_release(&listener->lock);