Lines Matching refs:evcb
452 event_callback_to_event(struct event_callback *evcb) in event_callback_to_event() argument
454 EVUTIL_ASSERT((evcb->evcb_flags & EVLIST_INIT)); in event_callback_to_event()
455 return EVUTIL_UPCAST(evcb, struct event, ev_evcallback); in event_callback_to_event()
734 struct event_callback *evcb, in event_base_cancel_single_callback_() argument
739 if (evcb->evcb_flags & EVLIST_INIT) { in event_base_cancel_single_callback_()
740 struct event *ev = event_callback_to_event(evcb); in event_base_cancel_single_callback_()
747 event_callback_cancel_nolock_(base, evcb, 1); in event_base_cancel_single_callback_()
752 if (run_finalizers && (evcb->evcb_flags & EVLIST_FINALIZING)) { in event_base_cancel_single_callback_()
753 switch (evcb->evcb_closure) { in event_base_cancel_single_callback_()
756 struct event *ev = event_callback_to_event(evcb); in event_base_cancel_single_callback_()
758 if (evcb->evcb_closure == EV_CLOSURE_EVENT_FINALIZE_FREE) in event_base_cancel_single_callback_()
763 evcb->evcb_cb_union.evcb_cbfinalize(evcb, evcb->evcb_arg); in event_base_cancel_single_callback_()
777 struct event_callback *evcb, *next; in event_base_free_queues_() local
778 for (evcb = TAILQ_FIRST(&base->activequeues[i]); evcb; ) { in event_base_free_queues_()
779 next = TAILQ_NEXT(evcb, evcb_active_next); in event_base_free_queues_()
780 deleted += event_base_cancel_single_callback_(base, evcb, run_finalizers); in event_base_free_queues_()
781 evcb = next; in event_base_free_queues_()
786 struct event_callback *evcb; in event_base_free_queues_() local
787 while ((evcb = TAILQ_FIRST(&base->active_later_queue))) { in event_base_free_queues_()
788 deleted += event_base_cancel_single_callback_(base, evcb, run_finalizers); in event_base_free_queues_()
1595 struct event_callback *evcb; in event_process_active_single_queue() local
1600 for (evcb = TAILQ_FIRST(activeq); evcb; evcb = TAILQ_FIRST(activeq)) { in event_process_active_single_queue()
1602 if (evcb->evcb_flags & EVLIST_INIT) { in event_process_active_single_queue()
1603 ev = event_callback_to_event(evcb); in event_process_active_single_queue()
1606 event_queue_remove_active(base, evcb); in event_process_active_single_queue()
1617 event_queue_remove_active(base, evcb); in event_process_active_single_queue()
1620 evcb, evcb->evcb_closure, evcb->evcb_cb_union.evcb_callback)); in event_process_active_single_queue()
1623 if (!(evcb->evcb_flags & EVLIST_INTERNAL)) in event_process_active_single_queue()
1627 base->current_event = evcb; in event_process_active_single_queue()
1632 switch (evcb->evcb_closure) { in event_process_active_single_queue()
1650 void (*evcb_selfcb)(struct event_callback *, void *) = evcb->evcb_cb_union.evcb_selfcb; in event_process_active_single_queue()
1652 evcb_selfcb(evcb, evcb->evcb_arg); in event_process_active_single_queue()
1658 int evcb_closure = evcb->evcb_closure; in event_process_active_single_queue()
1662 EVUTIL_ASSERT((evcb->evcb_flags & EVLIST_FINALIZING)); in event_process_active_single_queue()
1671 void (*evcb_cbfinalize)(struct event_callback *, void *) = evcb->evcb_cb_union.evcb_cbfinalize; in event_process_active_single_queue()
1673 EVUTIL_ASSERT((evcb->evcb_flags & EVLIST_FINALIZING)); in event_process_active_single_queue()
1675 evcb_cbfinalize(evcb, evcb->evcb_arg); in event_process_active_single_queue()
2149 struct event_callback *evcb = base->current_event; in event_base_get_running_event() local
2150 if (evcb->evcb_flags & EVLIST_INIT) in event_base_get_running_event()
2151 ev = event_callback_to_event(evcb); in event_base_get_running_event()
2239 …e_nolock_(struct event_base *base, unsigned flags, struct event_callback *evcb, void (*cb)(struct … in event_callback_finalize_nolock_() argument
2242 if (evcb->evcb_flags & EVLIST_INIT) { in event_callback_finalize_nolock_()
2243 ev = event_callback_to_event(evcb); in event_callback_finalize_nolock_()
2246 event_callback_cancel_nolock_(base, evcb, 0); /*XXX can this fail?*/ in event_callback_finalize_nolock_()
2249 evcb->evcb_closure = EV_CLOSURE_CB_FINALIZE; in event_callback_finalize_nolock_()
2250 evcb->evcb_cb_union.evcb_cbfinalize = cb; in event_callback_finalize_nolock_()
2251 event_callback_activate_nolock_(base, evcb); /* XXX can this really fail?*/ in event_callback_finalize_nolock_()
2252 evcb->evcb_flags |= EVLIST_FINALIZING; in event_callback_finalize_nolock_()
2256 event_callback_finalize_(struct event_base *base, unsigned flags, struct event_callback *evcb, void… in event_callback_finalize_() argument
2259 event_callback_finalize_nolock_(base, flags, evcb, cb); in event_callback_finalize_()
2282 struct event_callback *evcb = evcbs[i]; in event_callback_finalize_many_() local
2283 if (evcb == base->current_event) { in event_callback_finalize_many_()
2284 event_callback_finalize_nolock_(base, 0, evcb, cb); in event_callback_finalize_many_()
2287 event_callback_cancel_nolock_(base, evcb, 0); in event_callback_finalize_many_()
2942 struct event_callback *evcb) in event_callback_activate_() argument
2946 r = event_callback_activate_nolock_(base, evcb); in event_callback_activate_()
2953 struct event_callback *evcb) in event_callback_activate_nolock_() argument
2957 if (evcb->evcb_flags & EVLIST_FINALIZING) in event_callback_activate_nolock_()
2960 switch (evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)) { in event_callback_activate_nolock_()
2964 event_queue_remove_active_later(base, evcb); in event_callback_activate_nolock_()
2973 event_queue_insert_active(base, evcb); in event_callback_activate_nolock_()
2983 struct event_callback *evcb) in event_callback_activate_later_nolock_() argument
2985 if (evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)) in event_callback_activate_later_nolock_()
2988 event_queue_insert_active_later(base, evcb); in event_callback_activate_later_nolock_()
3004 struct event_callback *evcb) in event_callback_cancel_() argument
3008 r = event_callback_cancel_nolock_(base, evcb, 0); in event_callback_cancel_()
3015 struct event_callback *evcb, int even_if_finalizing) in event_callback_cancel_nolock_() argument
3017 if ((evcb->evcb_flags & EVLIST_FINALIZING) && !even_if_finalizing) in event_callback_cancel_nolock_()
3020 if (evcb->evcb_flags & EVLIST_INIT) in event_callback_cancel_nolock_()
3021 return event_del_nolock_(event_callback_to_event(evcb), in event_callback_cancel_nolock_()
3024 switch ((evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER))) { in event_callback_cancel_nolock_()
3031 event_queue_remove_active(base, evcb); in event_callback_cancel_nolock_()
3034 event_queue_remove_active_later(base, evcb); in event_callback_cancel_nolock_()
3185 event_queue_remove_active(struct event_base *base, struct event_callback *evcb) in event_queue_remove_active() argument
3188 if (EVUTIL_FAILURE_CHECK(!(evcb->evcb_flags & EVLIST_ACTIVE))) { in event_queue_remove_active()
3190 evcb, EVLIST_ACTIVE); in event_queue_remove_active()
3193 DECR_EVENT_COUNT(base, evcb->evcb_flags); in event_queue_remove_active()
3194 evcb->evcb_flags &= ~EVLIST_ACTIVE; in event_queue_remove_active()
3197 TAILQ_REMOVE(&base->activequeues[evcb->evcb_pri], in event_queue_remove_active()
3198 evcb, evcb_active_next); in event_queue_remove_active()
3201 event_queue_remove_active_later(struct event_base *base, struct event_callback *evcb) in event_queue_remove_active_later() argument
3204 if (EVUTIL_FAILURE_CHECK(!(evcb->evcb_flags & EVLIST_ACTIVE_LATER))) { in event_queue_remove_active_later()
3206 evcb, EVLIST_ACTIVE_LATER); in event_queue_remove_active_later()
3209 DECR_EVENT_COUNT(base, evcb->evcb_flags); in event_queue_remove_active_later()
3210 evcb->evcb_flags &= ~EVLIST_ACTIVE_LATER; in event_queue_remove_active_later()
3213 TAILQ_REMOVE(&base->active_later_queue, evcb, evcb_active_next); in event_queue_remove_active_later()
3326 event_queue_insert_active(struct event_base *base, struct event_callback *evcb) in event_queue_insert_active() argument
3330 if (evcb->evcb_flags & EVLIST_ACTIVE) { in event_queue_insert_active()
3335 INCR_EVENT_COUNT(base, evcb->evcb_flags); in event_queue_insert_active()
3337 evcb->evcb_flags |= EVLIST_ACTIVE; in event_queue_insert_active()
3341 EVUTIL_ASSERT(evcb->evcb_pri < base->nactivequeues); in event_queue_insert_active()
3342 TAILQ_INSERT_TAIL(&base->activequeues[evcb->evcb_pri], in event_queue_insert_active()
3343 evcb, evcb_active_next); in event_queue_insert_active()
3347 event_queue_insert_active_later(struct event_base *base, struct event_callback *evcb) in event_queue_insert_active_later() argument
3350 if (evcb->evcb_flags & (EVLIST_ACTIVE_LATER|EVLIST_ACTIVE)) { in event_queue_insert_active_later()
3355 INCR_EVENT_COUNT(base, evcb->evcb_flags); in event_queue_insert_active_later()
3356 evcb->evcb_flags |= EVLIST_ACTIVE_LATER; in event_queue_insert_active_later()
3359 EVUTIL_ASSERT(evcb->evcb_pri < base->nactivequeues); in event_queue_insert_active_later()
3360 TAILQ_INSERT_TAIL(&base->active_later_queue, evcb, evcb_active_next); in event_queue_insert_active_later()
3390 struct event_callback *evcb; in event_queue_make_later_events_active() local
3393 while ((evcb = TAILQ_FIRST(&base->active_later_queue))) { in event_queue_make_later_events_active()
3394 TAILQ_REMOVE(&base->active_later_queue, evcb, evcb_active_next); in event_queue_make_later_events_active()
3395 evcb->evcb_flags = (evcb->evcb_flags & ~EVLIST_ACTIVE_LATER) | EVLIST_ACTIVE; in event_queue_make_later_events_active()
3396 EVUTIL_ASSERT(evcb->evcb_pri < base->nactivequeues); in event_queue_make_later_events_active()
3397 TAILQ_INSERT_TAIL(&base->activequeues[evcb->evcb_pri], evcb, evcb_active_next); in event_queue_make_later_events_active()
3398 base->n_deferreds_queued += (evcb->evcb_closure == EV_CLOSURE_CB_SELF); in event_queue_make_later_events_active()
3671 struct event_callback *evcb; in event_base_foreach_event_nolock_() local
3672 TAILQ_FOREACH(evcb, &base->activequeues[i], evcb_active_next) { in event_base_foreach_event_nolock_()
3673 if ((evcb->evcb_flags & (EVLIST_INIT|EVLIST_INSERTED|EVLIST_TIMEOUT)) != EVLIST_INIT) { in event_base_foreach_event_nolock_()
3679 ev = event_callback_to_event(evcb); in event_base_foreach_event_nolock_()
3923 struct event_callback *evcb; in event_base_assert_ok_nolock_() local
3925 TAILQ_FOREACH(evcb, &base->activequeues[i], evcb_active_next) { in event_base_assert_ok_nolock_()
3926 EVUTIL_ASSERT((evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)) == EVLIST_ACTIVE); in event_base_assert_ok_nolock_()
3927 EVUTIL_ASSERT(evcb->evcb_pri == i); in event_base_assert_ok_nolock_()
3933 struct event_callback *evcb; in event_base_assert_ok_nolock_() local
3934 TAILQ_FOREACH(evcb, &base->active_later_queue, evcb_active_next) { in event_base_assert_ok_nolock_()
3935 EVUTIL_ASSERT((evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)) == EVLIST_ACTIVE_LATER); in event_base_assert_ok_nolock_()