From: Pavel Filipenský Date: Wed, 23 Mar 2022 13:50:57 +0000 (+0100) Subject: tevent: Use internally an empty trigger function for blocker requests X-Git-Tag: tevent-0.12.0~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfbb381839e9ea179cb53791606d6be08ebac806;p=thirdparty%2Fsamba.git tevent: Use internally an empty trigger function for blocker requests This avoids special magic, but keeps the same external behavior. It makes the following changes easier to understand. Signed-off-by: Pavel Filipenský Reviewed-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/lib/tevent/tevent_queue.c b/lib/tevent/tevent_queue.c index 070329b878c..ad68643c69f 100644 --- a/lib/tevent/tevent_queue.c +++ b/lib/tevent/tevent_queue.c @@ -149,6 +149,12 @@ static void tevent_queue_immediate_trigger(struct tevent_context *ev, q->list->trigger(q->list->req, q->list->private_data); } +static void tevent_queue_noop_trigger(struct tevent_req *req, + void *_private_data) +{ + /* this is doing nothing but blocking the queue */ +} + static struct tevent_queue_entry *tevent_queue_add_internal( struct tevent_queue *queue, struct tevent_context *ev, @@ -168,7 +174,7 @@ static struct tevent_queue_entry *tevent_queue_add_internal( * if there is no trigger, it is just a blocker */ if (trigger == NULL) { - e->triggered = true; + trigger = tevent_queue_noop_trigger; } e->queue = queue;