]> granicus.if.org Git - apache/commitdiff
Drawing attention to the timing problem; push the wait up so we do about
authorWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 8 Feb 2002 19:37:02 +0000 (19:37 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 8 Feb 2002 19:37:02 +0000 (19:37 +0000)
  nothing until WinNT initializes the app.

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

server/mpm/winnt/mpm_winnt.c

index 9a8a4e15d98f967ad5909a36890edf347d181c5e..a280fbcdcfb3e37eb8196a16c7782b15ce74d192 100644 (file)
@@ -1585,6 +1585,16 @@ 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);
@@ -1606,16 +1616,6 @@ static int create_process(apr_pool_t *p, HANDLE *child_proc, HANDLE *child_exit_
     ap_log_error(APLOG_MARK, APLOG_INFO, APR_SUCCESS, ap_server_conf,
                  "Parent: Created child process %d", pi.dwProcessId);
 
-    /* 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_handles_to_child(p, *child_exit_event, pi.hProcess, hPipeWrite)) {
         CloseHandle(hPipeWrite);
         return -1;