From: Dave Hart Date: Fri, 20 Mar 2009 03:18:35 +0000 (+0000) Subject: Merge shiny.ad.hartbrothers.com:c:\ntp\ntp-stable-873 X-Git-Tag: NTP_4_2_4P7_RC1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b9e4e19cc73661128ab44f333fb9d01eeea06f0;p=thirdparty%2Fntp.git Merge shiny.ad.hartbrothers.com:c:\ntp\ntp-stable-873 into shiny.ad.hartbrothers.com:C:/ntp/ntp-stable-pull bk: 49c30b0bJ7v0i7cRcxBwVBBXgWmg3A --- 1b9e4e19cc73661128ab44f333fb9d01eeea06f0 diff --cc ChangeLog index 8810c7751,acdd4e3c1..0dbf213ca --- a/ChangeLog +++ b/ChangeLog @@@ -1,10 -1,5 +1,13 @@@ ++ + * [Bug 873] Windows serial refclock proper TTY line discipline emulation + +* [Bug 1014] Enable building with VC9 (in Visual Studio 2008, Visual C++ 2008, or SDK) +* [Bug 1117] Deferred interface binding under Windows works only correctly + if FORCE_DNSRETRY is defined +* [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU +* DPRINTF macro made safer, always evaluates to a statement and will not + misassociate an else which follows the macro. + --- (4.2.4p6) 2009/01/08 Released by Harlan Stenn diff --cc ports/winnt/ntpd/ntp_iocompletionport.c index 737aa1ea1,7c7ec3b67..aade51964 --- a/ports/winnt/ntpd/ntp_iocompletionport.c +++ b/ports/winnt/ntpd/ntp_iocompletionport.c @@@ -42,9 -43,16 +43,20 @@@ typedef struct IoCompletionInfo #define recv_buf buff_space.rbuf #define trans_buf buff_space.tbuf ++ + #if !defined( _W64 ) + /* + * if ULONG_PTR needs to be defined then the build environment + * is pure 32 bit Windows. Since ULONG_PTR and DWORD have + * the same size in 32 bit Windows we can safely define + * a replacement. + */ + typedef DWORD ULONG_PTR; + #endif + +/* in nt_clockstuff.c */ +extern void lock_thread_to_processor(HANDLE); + /* * local function definitions */ @@@ -147,18 -149,12 +153,21 @@@ iocompletionthread(void *NotUsed BOOL bSuccess = FALSE; int errstatus = 0; DWORD BytesTransferred = 0; - DWORD Key = 0; + ULONG_PTR Key = 0; IoCompletionInfo * lpo = NULL; + u_long time_next_ifscan_after_error = 0; + + /* UNUSED_ARG(NotUsed); */ + /* + * socket and refclock receive call gettimeofday() + * so the I/O thread needs to be on the same + * processor as the main and timing threads + * to ensure consistent QueryPerformanceCounter() + * results. + */ + lock_thread_to_processor(GetCurrentThread()); + /* Set the thread priority high enough so I/O will * preempt normal recv packet processing, but not * higher than the timer sync thread.