forked from aniani/vim
patch 8.2.5129: timeout handling is not optimal
Problem: Timeout handling is not optimal. Solution: Avoid setting timeout_flag twice. Adjust the pointer when stopping the regexp timeout. Adjust variable name.
This commit is contained in:
@@ -8307,7 +8307,6 @@ start_timeout(long msec)
|
|||||||
// This is really the caller's responsibility, but let's make sure the
|
// This is really the caller's responsibility, but let's make sure the
|
||||||
// previous timer has been stopped.
|
// previous timer has been stopped.
|
||||||
stop_timeout();
|
stop_timeout();
|
||||||
timeout_flag = FALSE;
|
|
||||||
|
|
||||||
if (!timer_created)
|
if (!timer_created)
|
||||||
{
|
{
|
||||||
|
@@ -8335,7 +8335,7 @@ static int timer_active = FALSE;
|
|||||||
* timeouts.
|
* timeouts.
|
||||||
*/
|
*/
|
||||||
static int timeout_flags[2];
|
static int timeout_flags[2];
|
||||||
static int flag_idx = 0;
|
static int timeout_flag_idx = 0;
|
||||||
static int *timeout_flag = &timeout_flags[0];
|
static int *timeout_flag = &timeout_flags[0];
|
||||||
|
|
||||||
|
|
||||||
@@ -8383,7 +8383,7 @@ start_timeout(long msec)
|
|||||||
{
|
{
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
timeout_flag = &timeout_flags[flag_idx];
|
timeout_flag = &timeout_flags[timeout_flag_idx];
|
||||||
|
|
||||||
stop_timeout();
|
stop_timeout();
|
||||||
ret = CreateTimerQueueTimer(
|
ret = CreateTimerQueueTimer(
|
||||||
@@ -8395,7 +8395,7 @@ start_timeout(long msec)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
flag_idx = (flag_idx + 1) % 2;
|
timeout_flag_idx = (timeout_flag_idx + 1) % 2;
|
||||||
timer_active = TRUE;
|
timer_active = TRUE;
|
||||||
*timeout_flag = FALSE;
|
*timeout_flag = FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -61,6 +61,7 @@ init_regexp_timeout(long msec)
|
|||||||
disable_regexp_timeout(void)
|
disable_regexp_timeout(void)
|
||||||
{
|
{
|
||||||
stop_timeout();
|
stop_timeout();
|
||||||
|
timeout_flag = &dummy_timeout_flag;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -734,6 +734,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
5129,
|
||||||
/**/
|
/**/
|
||||||
5128,
|
5128,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user