From: Martin Burnicki Date: Fri, 20 Mar 2015 12:03:38 +0000 (+0100) Subject: [Bug 2790] If ntpd sets the Windows MM timer highest resolution then pause X-Git-Tag: NTP_4_3_10~3^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a5ad1af2b9024167de70a3b81105a53902a2d9e;p=thirdparty%2Fntp.git [Bug 2790] If ntpd sets the Windows MM timer highest resolution then pause briefly before measuring system clock precision to yield correct results. bk: 550c0c9aTvwsm95o3ZFcNueZPEsbbQ --- diff --git a/ChangeLog b/ChangeLog index 04fb22a9d..3012da385 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ --- - +* [Bug 2790] If ntpd sets the Windows MM timer highest resolution + pause briefly before measuring system clock precision to yield + correct results. * [Bug 2728] See if C99-style structure initialization works. * [Bug 2747] Upgrade libevent to 2.1.5-beta. * [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. . diff --git a/ports/winnt/ntpd/nt_clockstuff.c b/ports/winnt/ntpd/nt_clockstuff.c index 907c9f4ee..dc2f150b7 100644 --- a/ports/winnt/ntpd/nt_clockstuff.c +++ b/ports/winnt/ntpd/nt_clockstuff.c @@ -824,6 +824,10 @@ init_winnt_time(void) msyslog(LOG_INFO, "MM timer resolution: %u..%u msec, set to %u msec", tc.wPeriodMin, tc.wPeriodMax, wTimerRes ); + + /* Pause briefly before measuring the clock precision, see [Bug 2790] */ + Sleep( 33 ); + } else { msyslog(LOG_ERR, "Multimedia timer unavailable"); }