diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-04-13 22:27:00 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-04-15 18:23:11 +0200 |
commit | c8f409c2f297180ee06b474ef59653aebb817a4a (patch) | |
tree | 69e1162530c3c8a401eea236e45bbd0cc200b1ed | |
parent | 7598e6cf1741e2352bdb409a5a2fbc130f9117b9 (diff) | |
download | rneovim-c8f409c2f297180ee06b474ef59653aebb817a4a.tar.gz rneovim-c8f409c2f297180ee06b474ef59653aebb817a4a.tar.bz2 rneovim-c8f409c2f297180ee06b474ef59653aebb817a4a.zip |
loop: remove `children_stop_requests`
It serves no purpose because process_stop() is already guarded by
`proc->stopped_time`.
-rw-r--r-- | src/nvim/event/loop.c | 1 | ||||
-rw-r--r-- | src/nvim/event/loop.h | 1 | ||||
-rw-r--r-- | src/nvim/event/process.c | 17 |
3 files changed, 6 insertions, 13 deletions
diff --git a/src/nvim/event/loop.c b/src/nvim/event/loop.c index d92464f17b..7998e0b8d0 100644 --- a/src/nvim/event/loop.c +++ b/src/nvim/event/loop.c @@ -21,7 +21,6 @@ void loop_init(Loop *loop, void *data) loop->recursive = 0; loop->uv.data = loop; loop->children = kl_init(WatcherPtr); - loop->children_stop_requests = 0; loop->events = multiqueue_new_parent(loop_on_put, loop); loop->fast_events = multiqueue_new_child(loop->events); loop->thread_events = multiqueue_new_parent(NULL, NULL); diff --git a/src/nvim/event/loop.h b/src/nvim/event/loop.h index d1a40d5cc9..c0e2f49e4f 100644 --- a/src/nvim/event/loop.h +++ b/src/nvim/event/loop.h @@ -37,7 +37,6 @@ typedef struct loop { // generic timer, used by loop_poll_events() uv_timer_t poll_timer; - size_t children_stop_requests; uv_async_t async; uv_mutex_t mutex; int recursive; diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c index 60650344ce..6820194d5e 100644 --- a/src/nvim/event/process.c +++ b/src/nvim/event/process.c @@ -228,13 +228,10 @@ void process_stop(Process *proc) FUNC_ATTR_NONNULL_ALL } Loop *loop = proc->loop; - if (!loop->children_stop_requests++) { - // When there's at least one stop request pending, start a timer that - // will periodically check if a signal should be send to the job. - ILOG("starting job kill timer"); - uv_timer_start(&loop->children_kill_timer, children_kill_cb, - KILL_TIMEOUT_MS, KILL_TIMEOUT_MS); - } + // Start a timer to periodically check if a signal should be send to the job. + ILOG("starting job kill timer"); + uv_timer_start(&loop->children_kill_timer, children_kill_cb, + KILL_TIMEOUT_MS, KILL_TIMEOUT_MS); } /// Iterates the process list sending SIGTERM to stopped processes and SIGKILL @@ -383,10 +380,8 @@ static void process_close_handles(void **argv) static void on_process_exit(Process *proc) { Loop *loop = proc->loop; - if (proc->stopped_time && loop->children_stop_requests - && !--loop->children_stop_requests) { - // Stop the timer if no more stop requests are pending - DLOG("Stopping process kill timer"); + if (proc->stopped_time) { + DLOG("stopping process kill timer"); uv_timer_stop(&loop->children_kill_timer); } |