From a1dd70b1d0e9ef155c81eeb249f137e763482d10 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Sun, 2 Nov 2014 16:37:08 -0300 Subject: event: Reintroduce the immediate event queue Commit @264e0d872c("Remove automatic event deferral") removed the immediate event queue because event deferral now had to be explicit. The problem is that while some events don't need to be deferred, they still can result in recursive `event_poll` calls, and recursion is not supported by libuv. Examples of those are msgpack-rpc requests while a server->client request is pending, or signals which can call `mch_exit`(and that will result in `uv_run` calls). To fix the problem, this reintroduces the immediate event queue for events that can potentially result in event loop recursion. The non-deferred events are still processed in `event_poll`, but only after `uv_run` returns. --- src/nvim/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 6b6f008a44..caa936ba13 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -19541,7 +19541,7 @@ char_u *do_string_sub(char_u *str, char_u *pat, char_u *sub, char_u *flags) event_push((Event) { \ .handler = on_job_event, \ .data = event_data \ - }); \ + }, true); \ } while(0) static void on_job_stdout(RStream *rstream, void *data, bool eof) -- cgit