summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/tevent/tevent.h4
-rw-r--r--lib/tevent/tevent_queue.c7
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h
index 3b170a4dc8..c96ca354f5 100644
--- a/lib/tevent/tevent.h
+++ b/lib/tevent/tevent.h
@@ -1395,7 +1395,9 @@ typedef void (*tevent_queue_trigger_fn_t)(struct tevent_req *req,
* @param[in] req The tevent request to add to the queue.
*
* @param[in] trigger The function triggered by the queue when the request
- * is called.
+ * is called. Since tevent 0.9.14 it's possible to
+ * pass NULL, in order to just add a "blocker" to the
+ * queue.
*
* @param[in] private_data The private data passed to the trigger function.
*
diff --git a/lib/tevent/tevent_queue.c b/lib/tevent/tevent_queue.c
index 446804c9a5..3fca7fb948 100644
--- a/lib/tevent/tevent_queue.c
+++ b/lib/tevent/tevent_queue.c
@@ -163,6 +163,13 @@ bool tevent_queue_add(struct tevent_queue *queue,
e->trigger = trigger;
e->private_data = private_data;
+ /*
+ * if there is no trigger, it is just a blocker
+ */
+ if (trigger == NULL) {
+ e->triggered = true;
+ }
+
DLIST_ADD_END(queue->list, e, struct tevent_queue_entry *);
queue->length++;
talloc_set_destructor(e, tevent_queue_entry_destructor);