From 486594337a833cacd228313c1ecb793a1ec967e0 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sat, 21 Dec 2013 23:32:10 -0500 Subject: [PATCH] Add event_base_active_by_signal by analogy --- event.c | 9 +++++++++ include/event2/event.h | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/event.c b/event.c index 7a2cb20d..5dc23867 100644 --- a/event.c +++ b/event.c @@ -3640,6 +3640,15 @@ event_base_active_by_fd(struct event_base *base, evutil_socket_t fd, short event EVBASE_RELEASE_LOCK(base, th_base_lock); } +void +event_base_active_by_signal(struct event_base *base, int sig) +{ + EVBASE_ACQUIRE_LOCK(base, th_base_lock); + evmap_signal_active_(base, sig, 1); + EVBASE_RELEASE_LOCK(base, th_base_lock); +} + + void event_base_add_virtual_(struct event_base *base) { diff --git a/include/event2/event.h b/include/event2/event.h index b081429c..81efde3b 100644 --- a/include/event2/event.h +++ b/include/event2/event.h @@ -1473,6 +1473,13 @@ void event_base_dump_events(struct event_base *, FILE *); */ void event_base_active_by_fd(struct event_base *base, evutil_socket_t fd, short events); +/** + Activates all pending signals with a given signal number + + @param base the event_base on which to activate the events. + @param fd The signal to active events on. + */ +void event_base_active_by_signal(struct event_base *base, int sig); /** * Callback for iterating events in an event base via event_base_foreach_event -- 2.40.0