]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.5129: timeout handling is not optimal v8.2.5129
authorBram Moolenaar <Bram@vim.org>
Sun, 19 Jun 2022 13:36:35 +0000 (14:36 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 19 Jun 2022 13:36:35 +0000 (14:36 +0100)
Problem:    Timeout handling is not optimal.
Solution:   Avoid setting timeout_flag twice.  Adjust the pointer when
            stopping the regexp timeout.  Adjust variable name.

src/os_unix.c
src/os_win32.c
src/regexp.c
src/version.c

index 083fd8f9bec3642e5d684d6f8982ea6096bda683..c0293cefdcca8ab8f3c3cbad5f8bde767f5a5458 100644 (file)
@@ -8307,7 +8307,6 @@ start_timeout(long msec)
     // This is really the caller's responsibility, but let's make sure the
     // previous timer has been stopped.
     stop_timeout();
-    timeout_flag = FALSE;
 
     if (!timer_created)
     {
index 1adaaedcea42825e16a52dbf85647824429e9409..f3259350591ee5436cd12bebff4372da92a9f28a 100644 (file)
@@ -8335,7 +8335,7 @@ static int      timer_active = FALSE;
  * timeouts.
  */
 static int      timeout_flags[2];
-static int      flag_idx = 0;
+static int      timeout_flag_idx = 0;
 static int      *timeout_flag = &timeout_flags[0];
 
 
@@ -8383,7 +8383,7 @@ start_timeout(long msec)
 {
     BOOL ret;
 
-    timeout_flag = &timeout_flags[flag_idx];
+    timeout_flag = &timeout_flags[timeout_flag_idx];
 
     stop_timeout();
     ret = CreateTimerQueueTimer(
@@ -8395,7 +8395,7 @@ start_timeout(long msec)
     }
     else
     {
-       flag_idx = (flag_idx + 1) % 2;
+       timeout_flag_idx = (timeout_flag_idx + 1) % 2;
        timer_active = TRUE;
        *timeout_flag = FALSE;
     }
index 0a6a8af3d51ae011cc955b0f2afb24d2a0b8a26e..32661f6d8a64f0a7ca0aabffd37ae6c94962bba8 100644 (file)
@@ -61,6 +61,7 @@ init_regexp_timeout(long msec)
 disable_regexp_timeout(void)
 {
     stop_timeout();
+    timeout_flag = &dummy_timeout_flag;
 }
 #endif
 
index 75cbbaf2e9cabe0d2bcab5d74ae6782bb9bb567a..d038087541807c4184c5e8c6208b521d5ed16ff9 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    5129,
 /**/
     5128,
 /**/