You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2002/04/03 15:10:56 UTC

cvs commit: httpd-2.0/server/mpm/worker config5.m4 worker.c

trawick     02/04/03 05:10:56

  Modified:    .        CHANGES
               server/mpm/worker config5.m4 worker.c
  Log:
  Allow worker MPM to build on systems without pthread_kill().
  
  Submitted by:  Pier Fumagalli (and mangled by Jeff)
  
  Revision  Changes    Path
  1.679     +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.678
  retrieving revision 1.679
  diff -u -r1.678 -r1.679
  --- CHANGES	1 Apr 2002 22:26:08 -0000	1.678
  +++ CHANGES	3 Apr 2002 13:10:56 -0000	1.679
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.35
   
  +  *) Allow worker MPM to build on systems without pthread_kill().
  +     [Pier Fumagalli, Jeff Trawick]
  +
     *) Prevent ap_add_output_filters_by_type from being called in
        ap_set_content_type if the content-type hasn't changed.
        [Justin Erenkrantz]
  
  
  
  1.2       +1 -0      httpd-2.0/server/mpm/worker/config5.m4
  
  Index: config5.m4
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/worker/config5.m4,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- config5.m4	30 Jul 2001 05:02:53 -0000	1.1
  +++ config5.m4	3 Apr 2002 13:10:56 -0000	1.2
  @@ -1,5 +1,6 @@
   dnl ## XXX - Need a more thorough check of the proper flags to use
   
   if test "$MPM_NAME" = "worker" ; then
  +    AC_CHECK_FUNCS(pthread_kill)
       APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile)
   fi
  
  
  
  1.110     +14 -4     httpd-2.0/server/mpm/worker/worker.c
  
  Index: worker.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
  retrieving revision 1.109
  retrieving revision 1.110
  diff -u -r1.109 -r1.110
  --- worker.c	29 Mar 2002 14:33:50 -0000	1.109
  +++ worker.c	3 Apr 2002 13:10:56 -0000	1.110
  @@ -255,11 +255,15 @@
   {
       listener_may_exit = 1;
       /*
  -     * we should just be able to "kill(ap_my_pid, LISTENER_SIGNAL)" and wake
  -     * up the listener thread since it is the only thread with SIGHUP
  -     * unblocked, but that doesn't work on Linux
  +     * we should just be able to "kill(ap_my_pid, LISTENER_SIGNAL)" on all
  +     * platforms and wake up the listener thread since it is the only thread 
  +     * with SIGHUP unblocked, but that doesn't work on Linux
        */
  +#ifdef HAVE_PTHREAD_KILL
       pthread_kill(*listener_os_thread, LISTENER_SIGNAL);
  +#else
  +    kill(ap_my_pid, LISTENER_SIGNAL);
  +#endif
   }
   
   #define ST_INIT              0
  @@ -1043,7 +1047,13 @@
            */
   
           iter = 0;
  -        while (iter < 10 && pthread_kill(*listener_os_thread, 0) == 0) {
  +        while (iter < 10 && 
  +#ifdef HAVE_PTHREAD_KILL
  +               pthread_kill(*listener_os_thread, 0)
  +#else
  +               kill(ap_my_pid, 0)
  +#endif
  +               == 0) {
               /* listener not dead yet */
               apr_sleep(APR_USEC_PER_SEC / 2);
               wakeup_listener();