httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject Re: cvs commit: httpd-2.0/server/mpm/winnt mpm_winnt.c
Date Fri, 08 Feb 2002 22:15:44 GMT
The important thing here is that the process yields to allow the child to initialize. The
time of the sleep is really not important.  The thing that needs to happen is deep in the
OS, so I am not sure what we would mutex against. Yea, this does suck... it is a bug in
the OS AFAIK cause we shouldn;t have to jump through these hoops.

Bill

> wrowe       02/02/08 11:37:03
>
>   Modified:    server/mpm/winnt mpm_winnt.c
>   Log:
>     Drawing attention to the timing problem; push the wait up so we do about
>     nothing until WinNT initializes the app.
>
>   Revision  Changes    Path
>   1.229     +10 -10    httpd-2.0/server/mpm/winnt/mpm_winnt.c
>
>   Index: mpm_winnt.c
>   ===================================================================
>   RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm_winnt.c,v
>   retrieving revision 1.228
>   retrieving revision 1.229
>   diff -u -r1.228 -r1.229
>   --- mpm_winnt.c 6 Feb 2002 21:09:26 -0000 1.228
>   +++ mpm_winnt.c 8 Feb 2002 19:37:02 -0000 1.229
>   @@ -1585,6 +1585,16 @@
>                           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);
>   @@ -1605,16 +1615,6 @@
>
>        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);
>
>
>
>


Mime
View raw message