summaryrefslogtreecommitdiffstats
path: root/server/mpm/winnt
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2002-02-12 00:34:10 +0100
committerWilliam A. Rowe Jr <wrowe@apache.org>2002-02-12 00:34:10 +0100
commitc54cc841b53a77b3a65eeb43afc96898bd2adfdf (patch)
tree0261d555c4ec2d438ab20b9bc34c3e683c052c5b /server/mpm/winnt
parentif a child detects a resource shortage on accept(), limit the rate of fork()s (diff)
downloadapache2-c54cc841b53a77b3a65eeb43afc96898bd2adfdf.tar.xz
apache2-c54cc841b53a77b3a65eeb43afc96898bd2adfdf.zip
Move the sleep until after we have duplicated the simple handles. We must
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
Diffstat (limited to 'server/mpm/winnt')
-rw-r--r--server/mpm/winnt/mpm_winnt.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c
index 38ef538f88..ad10ec4b76 100644
--- a/server/mpm/winnt/mpm_winnt.c
+++ b/server/mpm/winnt/mpm_winnt.c
@@ -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;