diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-10-27 20:00:07 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-10-27 20:00:07 +0200 |
commit | 01688ad545ff0809ddad5c8fa6b149dc5d67312b (patch) | |
tree | f588850e3798caf6ddef56772a58903d8b3ab4eb /src/channel.c | |
parent | 2f97912800e86a296c001832bbbf2fc425f1e533 (diff) | |
download | vim-git-01688ad545ff0809ddad5c8fa6b149dc5d67312b.tar.gz |
patch 8.0.0050v8.0.0050
Problem: An exiting job is detected with a large latency.
Solution: Check for pending job more often. (Ozaki Kiichi) Change the
double loop in mch_inchar() into one.
Diffstat (limited to 'src/channel.c')
-rw-r--r-- | src/channel.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/channel.c b/src/channel.c index 0bd23785e..16156ce41 100644 --- a/src/channel.c +++ b/src/channel.c @@ -4643,8 +4643,8 @@ job_stop_on_exit(void) } /* - * Return TRUE when there is any job that might exit, which means - * job_check_ended() should be called once in a while. + * Return TRUE when there is any job that has an exit callback and might exit, + * which means job_check_ended() should be called more often. */ int has_pending_job(void) @@ -4652,7 +4652,11 @@ has_pending_job(void) job_T *job; for (job = first_job; job != NULL; job = job->jv_next) - if (job_still_alive(job)) + /* Only should check if the channel has been closed, if the channel is + * open the job won't exit. */ + if (job->jv_status == JOB_STARTED && job->jv_exit_cb != NULL + && (job->jv_channel == NULL + || !channel_still_useful(job->jv_channel))) return TRUE; return FALSE; } |