aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/event/queue.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-08-13 11:53:19 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-08-13 11:53:19 -0300
commitf1de097dbb236ea400150f80b909407ca9af7441 (patch)
tree2d69f4f3a06f0ac5a4e936ec40bde81a26cf2b53 /src/nvim/event/queue.c
parenta816c726bbae4361a30c95b1226aaaa1dc76fd24 (diff)
downloadrneovim-f1de097dbb236ea400150f80b909407ca9af7441.tar.gz
rneovim-f1de097dbb236ea400150f80b909407ca9af7441.tar.bz2
rneovim-f1de097dbb236ea400150f80b909407ca9af7441.zip
eval: Fix jobwait() to process multiple jobs concurrently
The new event processing architecture changed `jobwait()` semantics: Only one job is processed at time since process_wait only focuses on one queue. This fixes the problem with a few changes: - Allow the event queue polled by `process_wait` to be overriden by a new argument. - Allow the parent queue to be overriden with `queue_replace_parent` - Create a temporary queue that serves as the parent for all jobs passed to `jobwait()`
Diffstat (limited to 'src/nvim/event/queue.c')
-rw-r--r--src/nvim/event/queue.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/event/queue.c b/src/nvim/event/queue.c
index 3f03dd444e..19eca14144 100644
--- a/src/nvim/event/queue.c
+++ b/src/nvim/event/queue.c
@@ -152,6 +152,12 @@ bool queue_empty(Queue *queue)
return QUEUE_EMPTY(&queue->headtail);
}
+void queue_replace_parent(Queue *queue, Queue *new_parent)
+{
+ assert(queue_empty(queue));
+ queue->parent = new_parent;
+}
+
static Event queue_remove(Queue *queue)
{
assert(!queue_empty(queue));