diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-06-19 14:36:35 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-06-19 14:36:35 +0100 |
commit | 1f30caff8b63beda75a5dcd15ffe3e9e818ed483 (patch) | |
tree | 29aa0c49c7ead7d8298f49165f0db9aaa09bcc6d | |
parent | 6f0cf62df97ee7c9d26b550adaf469be7fe1e09a (diff) | |
download | vim-git-8.2.5129.tar.gz |
patch 8.2.5129: timeout handling is not optimalv8.2.5129
Problem: Timeout handling is not optimal.
Solution: Avoid setting timeout_flag twice. Adjust the pointer when
stopping the regexp timeout. Adjust variable name.
-rw-r--r-- | src/os_unix.c | 1 | ||||
-rw-r--r-- | src/os_win32.c | 6 | ||||
-rw-r--r-- | src/regexp.c | 1 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 6 insertions, 4 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 083fd8f9b..c0293cefd 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -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) { diff --git a/src/os_win32.c b/src/os_win32.c index 1adaaedce..f32593505 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -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; } diff --git a/src/regexp.c b/src/regexp.c index 0a6a8af3d..32661f6d8 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -61,6 +61,7 @@ init_regexp_timeout(long msec) disable_regexp_timeout(void) { stop_timeout(); + timeout_flag = &dummy_timeout_flag; } #endif diff --git a/src/version.c b/src/version.c index 75cbbaf2e..d03808754 100644 --- a/src/version.c +++ b/src/version.c @@ -735,6 +735,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 5129, +/**/ 5128, /**/ 5127, |