Mercurial > vim
comparison src/misc2.c @ 10406:42911b233245 v8.0.0097
commit https://github.com/vim/vim/commit/833eb1d752426689051bf2001083359899536939
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 24 17:22:50 2016 +0100
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 24 Nov 2016 17:30:04 +0100 |
parents | 66f1b5bf3fa6 |
children | 56cb9538386c |
comparison
equal
deleted
inserted
replaced
10405:4d35d83f4537 | 10406:42911b233245 |
---|---|
6261 /* Check if any jobs have ended. */ | 6261 /* Check if any jobs have ended. */ |
6262 job_check_ended(); | 6262 job_check_ended(); |
6263 # endif | 6263 # endif |
6264 } | 6264 } |
6265 #endif | 6265 #endif |
6266 | |
6267 #ifdef ELAPSED_TIMEVAL /* proto is defined in vim.h */ | |
6268 /* | |
6269 * Return time in msec since "start_tv". | |
6270 */ | |
6271 long | |
6272 elapsed(struct timeval *start_tv) | |
6273 { | |
6274 struct timeval now_tv; | |
6275 | |
6276 gettimeofday(&now_tv, NULL); | |
6277 return (now_tv.tv_sec - start_tv->tv_sec) * 1000L | |
6278 + (now_tv.tv_usec - start_tv->tv_usec) / 1000L; | |
6279 } | |
6280 #endif | |
6281 | |
6282 #ifdef ELAPSED_TICKCOUNT | |
6283 /* | |
6284 * Return time in msec since "start_tick". | |
6285 */ | |
6286 long | |
6287 elapsed(DWORD start_tick) | |
6288 { | |
6289 DWORD now = GetTickCount(); | |
6290 | |
6291 if (now < start_tick) | |
6292 /* overflow */ | |
6293 return (long)now; | |
6294 return (long)now - (long)start_tick; | |
6295 } | |
6296 #endif |