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