1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Render timing.c robust in the face of strangeness. The strangenesses

in question vary per OS: on Windows the problem is that WM_TIMER
sometimes goes off too early, so that GetTickCount() is right and
the callback time is wrong, whereas on Unix the problem is that my
GETTICKCOUNT implementation comes from the system clock which means
it can change suddenly and non-monotonically if the sysadmin is
messing about (meaning that the timing of callbacks from GTK or
select timeouts is _more_ likely to be right than GETTICKCOUNT).
This checkin provides band-aid workarounds for both problems, which
aren't pretty but ought to at least prevent catastrophic assertion
failure.

[originally from svn r5556]
This commit is contained in:
Simon Tatham
2005-03-28 17:48:24 +00:00
parent 2daa1b737c
commit d0beed9aba
6 changed files with 120 additions and 6 deletions

View File

@ -138,6 +138,15 @@ GLOBAL void *logctx;
#define FILTER_WAVE_FILES ("Wave Files (*.wav)\0*.WAV\0" \
"All Files (*.*)\0*\0\0\0")
/*
* On some versions of Windows, it has been known for WM_TIMER to
* occasionally get its callback time simply wrong, and call us
* back several minutes early. Defining these symbols enables
* compensation code in timing.c.
*/
#define TIMING_SYNC
#define TIMING_SYNC_TICKCOUNT
/*
* winnet.c dynamically loads WinSock 2 or WinSock 1 depending on
* what it can get, which means any WinSock routines used outside