]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tevent: Use internally an empty trigger function for blocker requests
authorPavel Filipenský <pfilipen@redhat.com>
Wed, 23 Mar 2022 13:50:57 +0000 (14:50 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 11 Apr 2022 16:56:35 +0000 (16:56 +0000)
This avoids special magic, but keeps the same external behavior.

It makes the following changes easier to understand.

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/tevent/tevent_queue.c

index 070329b878cad0f93a8806899a49a20e7387e531..ad68643c69f45f7e983b28d75bc83cd1215793e9 100644 (file)
@@ -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;