Add event_base_active_by_signal by analogy

This commit is contained in:
Nick Mathewson 2013-12-21 23:32:10 -05:00
parent 5c9da9a8a8
commit 486594337a
2 changed files with 16 additions and 0 deletions

View File

@ -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); 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 void
event_base_add_virtual_(struct event_base *base) event_base_add_virtual_(struct event_base *base)
{ {

View File

@ -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); 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 * Callback for iterating events in an event base via event_base_foreach_event