From 696f9c2759b078f749625d167f3424915586108d Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 24 Jul 2015 11:56:44 -0300 Subject: process: Pass loop reference during initialization Change the API so that it is passed to {uv,pty}_process_init instead of `process_spawn`. --- src/nvim/event/process.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/event/process.h') diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h index 5c84a7d1d0..7ef2b24b7f 100644 --- a/src/nvim/event/process.h +++ b/src/nvim/event/process.h @@ -28,12 +28,12 @@ struct process { bool closed, term_sent; }; -static inline Process process_init(ProcessType type, void *data) +static inline Process process_init(Loop *loop, ProcessType type, void *data) { return (Process) { .type = type, .data = data, - .loop = NULL, + .loop = loop, .pid = 0, .status = 0, .refcount = 0, -- cgit From 502aee690c980fcb3cfcb3f211dcfad06103db46 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 7 Aug 2015 22:54:02 -0300 Subject: event: Refactor async event processing - Improve the implementation of deferred/immediate events. - Use the new queue module to change how/when events are queued/processed by giving a private queue to each emitter. - Immediate events(which only exist to break uv_run recursion) are now represented in the `loop->fast_events` queue. - Events pushed to child queues are propagated to the event loop main queue and processed as K_EVENT keys. --- src/nvim/event/process.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nvim/event/process.h') diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h index 7ef2b24b7f..45edc46b95 100644 --- a/src/nvim/event/process.h +++ b/src/nvim/event/process.h @@ -26,6 +26,7 @@ struct process { process_exit_cb cb; internal_process_cb internal_exit_cb, internal_close_cb; bool closed, term_sent; + Queue *events; }; static inline Process process_init(Loop *loop, ProcessType type, void *data) @@ -34,6 +35,7 @@ static inline Process process_init(Loop *loop, ProcessType type, void *data) .type = type, .data = data, .loop = loop, + .events = NULL, .pid = 0, .status = 0, .refcount = 0, -- cgit