0
0
mirror of https://github.com/vim/vim.git synced 2025-10-06 05:44:14 -04:00

patch 8.0.0097

Problem:    When a channel callback consumes a lot of time Vim becomes
            unresponsive. (skywind)
Solution:   Bail out of checking channel readahead after 100 msec.
This commit is contained in:
Bram Moolenaar
2016-11-24 17:22:50 +01:00
parent 2cab0e1910
commit 833eb1d752
6 changed files with 88 additions and 48 deletions

View File

@@ -6263,3 +6263,34 @@ parse_queued_messages(void)
# endif
}
#endif
#ifdef ELAPSED_TIMEVAL /* proto is defined in vim.h */
/*
* Return time in msec since "start_tv".
*/
long
elapsed(struct timeval *start_tv)
{
struct timeval now_tv;
gettimeofday(&now_tv, NULL);
return (now_tv.tv_sec - start_tv->tv_sec) * 1000L
+ (now_tv.tv_usec - start_tv->tv_usec) / 1000L;
}
#endif
#ifdef ELAPSED_TICKCOUNT
/*
* Return time in msec since "start_tick".
*/
long
elapsed(DWORD start_tick)
{
DWORD now = GetTickCount();
if (now < start_tick)
/* overflow */
return (long)now;
return (long)now - (long)start_tick;
}
#endif