mirror of
https://github.com/neovim/neovim.git
synced 2026-01-17 10:38:57 +10:00
loop: remove children_stop_requests
It serves no purpose because process_stop() is already guarded by `proc->stopped_time`.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user