]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2790] If ntpd sets the Windows MM timer highest resolution then pause
authorMartin Burnicki <burnicki@ntp.org>
Fri, 20 Mar 2015 12:03:38 +0000 (13:03 +0100)
committerMartin Burnicki <burnicki@ntp.org>
Fri, 20 Mar 2015 12:03:38 +0000 (13:03 +0100)
briefly before measuring system clock precision to yield correct results.

bk: 550c0c9aTvwsm95o3ZFcNueZPEsbbQ

ChangeLog
ports/winnt/ntpd/nt_clockstuff.c

index 04fb22a9d9d4188e20541d27d216fb2d1f208365..3012da3852caa339029500aa1bf85f3c39a9b3b0 100644 (file)
--- 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. .
index 907c9f4ee3e0dc6b89e04ea51fe8b074297e44ec..dc2f150b726adf2cbc5fefac8a6ac71a43405cb4 100644 (file)
@@ -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");
                }