]> granicus.if.org Git - apache/commitdiff
Move the sleep until after we have duplicated the simple handles. We must
authorWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 11 Feb 2002 23:34:10 +0000 (23:34 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 11 Feb 2002 23:34:10 +0000 (23:34 +0000)
  still pause and reflect on the Child's startup before WSADuplicateHandle()

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93367 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/winnt/mpm_winnt.c

index 38ef538f8803e9a92ddc98c227bd5339aeb5ac35..ad10ec4b76c7302b725f034ae2988dd32d2f18d9 100644 (file)
@@ -1587,16 +1587,6 @@ static int create_process(apr_pool_t *p, HANDLE *child_proc, HANDLE *child_exit_
                        NULL,
                        &si, &pi);
 
-    /* Important:
-     * Give the child process a chance to run before dup'ing the sockets.
-     * We have already set the listening sockets noninheritable, but if 
-     * WSADuplicateSocket runs before the child process initializes
-     * the listeners will be inherited anyway.
-     *
-     * XXX: This is badness; needs some mutex interlocking
-     */
-    Sleep(1000);
-
     /* Undo everything we created for the child only
      */
     CloseHandle(pi.hThread);
@@ -1628,6 +1618,16 @@ static int create_process(apr_pool_t *p, HANDLE *child_proc, HANDLE *child_exit_
         return -1;
     }
 
+    /* Important:
+     * Give the child process a chance to run before dup'ing the sockets.
+     * We have already set the listening sockets noninheritable, but if 
+     * WSADuplicateSocket runs before the child process initializes
+     * the listeners will be inherited anyway.
+     *
+     * XXX: This is badness; needs some mutex interlocking
+     */
+    Sleep(1000);
+
     if (send_listeners_to_child(p, pi.dwProcessId, hPipeWrite)) {
         CloseHandle(hPipeWrite);        
         return -1;