summaryrefslogtreecommitdiff
path: root/lib/tevent/tevent_queue.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-07-28 09:45:15 +0200
committerStefan Metzmacher <metze@samba.org>2011-08-09 21:37:41 +0200
commitaba9d48f55b7e69af0967d0f435843c833357ec7 (patch)
tree8609d3f96c11e62e8f7a305755f5f24694a232b2 /lib/tevent/tevent_queue.c
parent3c38ec72e74dd60b81964ebf661f5d5af8724968 (diff)
downloadsamba-aba9d48f55b7e69af0967d0f435843c833357ec7.tar.gz
samba-aba9d48f55b7e69af0967d0f435843c833357ec7.tar.bz2
samba-aba9d48f55b7e69af0967d0f435843c833357ec7.zip
tevent: allow tevent_queue_add() to take a NULL trigger function
This way the caller can add a blocker to the queue. metze
Diffstat (limited to 'lib/tevent/tevent_queue.c')
-rw-r--r--lib/tevent/tevent_queue.c7
1 files changed, 7 insertions, 0 deletions
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);