From: William A. Rowe Jr Date: Fri, 8 Feb 2002 19:37:02 +0000 (+0000) Subject: Drawing attention to the timing problem; push the wait up so we do about X-Git-Tag: 2.0.32~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69c9e8d02f832815fadaf6a71b483664b455fca8;p=apache Drawing attention to the timing problem; push the wait up so we do about nothing until WinNT initializes the app. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93342 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 9a8a4e15d9..a280fbcdcf 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -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;