Skip to content

Commit

Permalink
code review: asserting that event_queue_remove_active was called in…
Browse files Browse the repository at this point in the history
…side `event_del_nolock_`
  • Loading branch information
Coeur committed May 4, 2024
1 parent 8dbede3 commit 14e284f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ event_process_active_single_queue(struct event_base *base,
EVUTIL_ASSERT(activeq != NULL);

for (evcb = TAILQ_FIRST(activeq); evcb; evcb = TAILQ_FIRST(activeq)) {
struct event *ev=NULL;
struct event *ev = NULL;
if (evcb->evcb_flags & EVLIST_INIT) {
ev = event_callback_to_event(evcb);

Expand All @@ -1698,6 +1698,7 @@ event_process_active_single_queue(struct event_base *base,
"closure %d, call %p",
(void *)evcb, evcb->evcb_closure, (void *)evcb->evcb_cb_union.evcb_callback));
}
EVUTIL_ASSERT(evcb != TAILQ_FIRST(activeq));

if (!(evcb->evcb_flags & EVLIST_INTERNAL))
++count;
Expand Down Expand Up @@ -1744,7 +1745,7 @@ event_process_active_single_queue(struct event_base *base,
EVBASE_RELEASE_LOCK(base, th_base_lock);
event_debug_note_teardown_(ev);
evcb_evfinalize(ev, ev->ev_arg);
if (evcb_closure == EV_CLOSURE_EVENT_FINALIZE_FREE && evcb != TAILQ_FIRST(activeq))
if (evcb_closure == EV_CLOSURE_EVENT_FINALIZE_FREE)
mm_free(ev);
}
break;
Expand Down

0 comments on commit 14e284f

Please sign in to comment.