]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Keep add_full_recv_buffer() and SetEvent(WaitableIoEventHandle) 1:1
authorDave Hart <hart@ntp.org>
Wed, 5 Oct 2011 08:34:46 +0000 (08:34 +0000)
committerDave Hart <hart@ntp.org>
Wed, 5 Oct 2011 08:34:46 +0000 (08:34 +0000)
bk: 4e8c16a6IAYWfI3PBxKdERPxDruffw

include/ntp_refclock.h
ntpd/ntp_refclock.c
ntpd/refclock_parse.c
ports/winnt/ntpd/ntp_iocompletionport.c

index 1d7764e8d986e6cb226233fd7d74627f15cdbfea..b22b6bee6de011f7f43a5d1b7b342f089cbe51b5 100644 (file)
@@ -120,6 +120,10 @@ struct refclockbug {
        l_fp    times[NCLKBUGTIMES]; /* real times */
 };
 
+#ifdef HAVE_IO_COMPLETION_PORT
+extern HANDLE  WaitableIoEventHandle;
+#endif
+
 /*
  * Structure interface between the reference clock support
  * ntp_refclock.c and the driver utility routines
index d5a36973c0113b2e7d927eb613b7b54a260575f1..f6e527fcdd161495d8237b15eb6844b92f5bcb5d 100644 (file)
@@ -674,7 +674,9 @@ indicate_refclock_packet(
                return TRUE;
        }
        add_full_recv_buffer(rb);
-
+#ifdef HAVE_IO_COMPLETION_PORT
+       SetEvent(WaitableIoEventHandle);
+#endif
        return FALSE;
 }
 
index 71ef5272560ad6d6b0611785fbd877986a061b7b..046a1d62b5edd802c7c4e662cbc9bce4a06aa549 100644 (file)
@@ -2323,6 +2323,9 @@ local_input(
                                        parse->generic->io.recvcount++;
                                        packets_received++;
                                        add_full_recv_buffer(buf);
+#ifdef HAVE_IO_COMPLETION_PORT
+                                       SetEvent(WaitableIoEventHandle);
+#endif
                                }
                                parse_iodone(&parse->parseio);
                        }
index eb1c7e4408e49a128da61ec5097af63104bae3af..aca63372239434635a0cc5758dae33e6ae55b96b 100644 (file)
@@ -88,8 +88,8 @@ static HANDLE hHeapHandle = NULL;
 #endif
 
        HANDLE WaitableExitEventHandle;
-static HANDLE hIoCompletionPort = NULL;
-static HANDLE WaitableIoEventHandle = NULL;
+       HANDLE WaitableIoEventHandle;
+static HANDLE hIoCompletionPort;
 
 #ifdef NTPNEEDNAMEDHANDLE
 #define WAITABLEIOEVENTHANDLE "WaitableIoEventHandle"
@@ -616,7 +616,6 @@ OnSerialReadComplete(
                        if (!consumed) {
                                packets_received++;
                                handler_pkts++;
-                               SetEvent(WaitableIoEventHandle);
                        }
                        buff = get_free_recv_buffer_alloc();
                }
@@ -688,7 +687,6 @@ OnRawSerialReadComplete(
                        rio->recvcount++;
                        packets_received++;
                        handler_pkts++;
-                       SetEvent(WaitableIoEventHandle);
                }
                rbufp = get_free_recv_buffer_alloc();
        }