From: Dave Hart Date: Fri, 20 Mar 2009 02:29:49 +0000 (+0000) Subject: Merge pogo.udel.edu:/pogo/users/hart/ntp-dev-873 X-Git-Tag: NTP_4_2_5P160~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3fcd97a71914da67fc307e25e8cf42a12745426;p=thirdparty%2Fntp.git Merge pogo.udel.edu:/pogo/users/hart/ntp-dev-873 into pogo.udel.edu:/pogo/users/hart/ntp-dev-pull bk: 49c2ff9dLFi6xoc_VJtiJCZb7tWxgg --- a3fcd97a71914da67fc307e25e8cf42a12745426 diff --cc ChangeLog index a9beb10d4,e57542c46..a905d9505 --- a/ChangeLog +++ b/ChangeLog @@@ -1,7 -1,4 +1,8 @@@ + * [Bug 873] Windows serial refclock proper TTY line discipline emulation +* [Bug 1117] Deferred interface binding under Windows works only correctly + if FORCE_DNSRETRY is defined +* [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU +* [Bug 1014] Enable building with VC9 (in Visual Studio 2008, Visual C++ 2008, or SDK) (4.2.5p158) 2009/01/30 Released by Harlan Stenn * Fix [CID 72], a typo introduced at the latest fix to prettydate.c. (4.2.5p157) 2009/01/26 Released by Harlan Stenn diff --cc ports/winnt/ntpd/ntp_iocompletionport.c index 16f8866b5,7734a848b..b60ef6393 --- a/ports/winnt/ntpd/ntp_iocompletionport.c +++ b/ports/winnt/ntpd/ntp_iocompletionport.c @@@ -42,9 -43,16 +43,19 @@@ 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 +152,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.