summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-08-28 16:53:12 +0200
committerBram Moolenaar <Bram@vim.org>2016-08-28 16:53:12 +0200
commit0abe0522d0e52b50c6eab52323be558eb56fe95e (patch)
treeea87f5f2ba35ec4eff24185552d46fe6a8c8696f /src
parent0426bae2abede764d0dd366a28663d1c6e6ab0fe (diff)
downloadvim-git-0abe0522d0e52b50c6eab52323be558eb56fe95e.tar.gz
patch 7.4.2282v7.4.2282
Problem: When a child process is very fast waiting 10 msec for it is noticeable. (Ramel Eshed) Solution: Start waiting for 1 msec and gradually increase.
Diffstat (limited to 'src')
-rw-r--r--src/os_unix.c15
-rw-r--r--src/version.c2
2 files changed, 14 insertions, 3 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index d5c5d846b..941e8e899 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3934,6 +3934,7 @@ mch_new_shellsize(void)
wait4pid(pid_t child, waitstatus *status)
{
pid_t wait_pid = 0;
+ long delay_msec = 1;
while (wait_pid != child)
{
@@ -3948,8 +3949,10 @@ wait4pid(pid_t child, waitstatus *status)
# endif
if (wait_pid == 0)
{
- /* Wait for 10 msec before trying again. */
- mch_delay(10L, TRUE);
+ /* Wait for 1 to 10 msec before trying again. */
+ mch_delay(delay_msec, TRUE);
+ if (++delay_msec > 10)
+ delay_msec = 10;
continue;
}
if (wait_pid <= 0
@@ -4929,6 +4932,8 @@ finished:
# if defined(FEAT_XCLIPBOARD) && defined(FEAT_X11)
else
{
+ long delay_msec = 1;
+
/*
* Similar to the loop above, but only handle X events, no
* I/O.
@@ -4961,7 +4966,11 @@ finished:
/* Handle any X events, e.g. serving the clipboard. */
clip_update();
- mch_delay(10L, TRUE);
+ /* Wait for 1 to 10 msec. 1 is faster but gives the child
+ * less time. */
+ mch_delay(delay_msec, TRUE);
+ if (++delay_msec > 10)
+ delay_msec = 10;
}
}
# endif
diff --git a/src/version.c b/src/version.c
index afe9c981c..5743911f6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2282,
+/**/
2281,
/**/
2280,