Lines Matching refs:base

119 evsig_set_base(struct event_base *base)  in evsig_set_base()  argument
122 evsig_base = base; in evsig_set_base()
123 evsig_base_n_signals_added = base->sig.ev_n_signals_added; in evsig_set_base()
124 evsig_base_fd = base->sig.ev_signal_pair[0]; in evsig_set_base()
136 struct event_base *base; in evsig_cb() local
138 base = arg; in evsig_cb()
160 EVBASE_ACQUIRE_LOCK(base, th_base_lock); in evsig_cb()
163 evmap_signal_active(base, i, ncaught[i]); in evsig_cb()
165 EVBASE_RELEASE_LOCK(base, th_base_lock); in evsig_cb()
169 evsig_init(struct event_base *base) in evsig_init() argument
177 AF_UNIX, SOCK_STREAM, 0, base->sig.ev_signal_pair) == -1) { in evsig_init()
188 evutil_make_socket_closeonexec(base->sig.ev_signal_pair[0]); in evsig_init()
189 evutil_make_socket_closeonexec(base->sig.ev_signal_pair[1]); in evsig_init()
190 base->sig.sh_old = NULL; in evsig_init()
191 base->sig.sh_old_max = 0; in evsig_init()
193 evutil_make_socket_nonblocking(base->sig.ev_signal_pair[0]); in evsig_init()
194 evutil_make_socket_nonblocking(base->sig.ev_signal_pair[1]); in evsig_init()
196 event_assign(&base->sig.ev_signal, base, base->sig.ev_signal_pair[1], in evsig_init()
197 EV_READ | EV_PERSIST, evsig_cb, base); in evsig_init()
199 base->sig.ev_signal.ev_flags |= EVLIST_INTERNAL; in evsig_init()
200 event_priority_set(&base->sig.ev_signal, 0); in evsig_init()
202 base->evsigsel = &evsigops; in evsig_init()
210 _evsig_set_handler(struct event_base *base, in _evsig_set_handler() argument
218 struct evsig_info *sig = &base->sig; in _evsig_set_handler()
276 evsig_add(struct event_base *base, evutil_socket_t evsignal, short old, short events, void *p) in evsig_add() argument
278 struct evsig_info *sig = &base->sig; in evsig_add()
285 if (evsig_base != base && evsig_base_n_signals_added) { in evsig_add()
292 base, evsig_base, base->evsel->name); in evsig_add()
294 evsig_base = base; in evsig_add()
296 evsig_base_fd = base->sig.ev_signal_pair[0]; in evsig_add()
300 if (_evsig_set_handler(base, (int)evsignal, evsig_handler) == -1) { in evsig_add()
322 _evsig_restore_handler(struct event_base *base, int evsignal) in _evsig_restore_handler() argument
325 struct evsig_info *sig = &base->sig; in _evsig_restore_handler()
353 evsig_del(struct event_base *base, evutil_socket_t evsignal, short old, short events, void *p) in evsig_del() argument
362 --base->sig.ev_n_signals_added; in evsig_del()
365 return (_evsig_restore_handler(base, (int)evsignal)); in evsig_del()
398 evsig_dealloc(struct event_base *base) in evsig_dealloc() argument
401 if (base->sig.ev_signal_added) { in evsig_dealloc()
402 event_del(&base->sig.ev_signal); in evsig_dealloc()
403 base->sig.ev_signal_added = 0; in evsig_dealloc()
407 event_debug_unassign(&base->sig.ev_signal); in evsig_dealloc()
410 if (i < base->sig.sh_old_max && base->sig.sh_old[i] != NULL) in evsig_dealloc()
411 _evsig_restore_handler(base, i); in evsig_dealloc()
414 if (base == evsig_base) { in evsig_dealloc()
421 if (base->sig.ev_signal_pair[0] != -1) { in evsig_dealloc()
422 evutil_closesocket(base->sig.ev_signal_pair[0]); in evsig_dealloc()
423 base->sig.ev_signal_pair[0] = -1; in evsig_dealloc()
425 if (base->sig.ev_signal_pair[1] != -1) { in evsig_dealloc()
426 evutil_closesocket(base->sig.ev_signal_pair[1]); in evsig_dealloc()
427 base->sig.ev_signal_pair[1] = -1; in evsig_dealloc()
429 base->sig.sh_old_max = 0; in evsig_dealloc()
432 if (base->sig.sh_old) { in evsig_dealloc()
433 mm_free(base->sig.sh_old); in evsig_dealloc()
434 base->sig.sh_old = NULL; in evsig_dealloc()