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

cvs commit: httpd-2.0/server/mpm/experimental/leader mpm.h leader.c Makefile.in

brianp      02/05/21 18:04:59

  Modified:    server/mpm/experimental/leader mpm.h leader.c Makefile.in
  Log:
  Switch to prefork-style POD handling
  
  Revision  Changes    Path
  1.4       +1 -0      httpd-2.0/server/mpm/experimental/leader/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/experimental/leader/mpm.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- mpm.h	12 Apr 2002 04:24:44 -0000	1.3
  +++ mpm.h	22 May 2002 01:04:59 -0000	1.4
  @@ -76,6 +76,7 @@
   #define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
   #define AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK
   
  +#define AP_MPM_USES_POD 1
   #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
   #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
   #define MPM_ACCEPT_FUNC unixd_accept
  
  
  
  1.18      +14 -5     httpd-2.0/server/mpm/experimental/leader/leader.c
  
  Index: leader.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/experimental/leader/leader.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- leader.c	22 May 2002 00:47:31 -0000	1.17
  +++ leader.c	22 May 2002 01:04:59 -0000	1.18
  @@ -103,7 +103,6 @@
   #include "http_connection.h"
   #include "ap_mpm.h"
   #include "mpm_common.h"
  -#include "pod.h"
   #include "ap_listen.h"
   #include "scoreboard.h" 
   #include "mpm_default.h"
  @@ -481,6 +480,7 @@
       if (pchild) {
           apr_pool_destroy(pchild);
       }
  +    ap_mpm_pod_close(pod);
       exit(code);
   }
   
  @@ -940,6 +940,10 @@
                   apr_pool_clear(ptrans);
                   requests_this_child--;
               }
  +            if (ap_mpm_pod_check(pod) == APR_SUCCESS) { /* selected as idle? */
  +                signal_threads(ST_GRACEFUL);
  +                break;
  +            }
           }
           else {
               if ((rv = SAFE_ACCEPT(apr_proc_mutex_unlock(accept_mutex)))
  @@ -1221,6 +1225,7 @@
            */
           unblock_signal(SIGTERM);
           apr_signal(SIGTERM, dummy_signal_handler);
  +#if 0
           /* Watch for any messages from the parent over the POD */
           while (1) {
               rv = ap_mpm_pod_check(pod);
  @@ -1255,6 +1260,10 @@
                */
               join_workers(threads);
           }
  +#else
  +        join_start_thread(start_thread_id);
  +        join_workers(threads);
  +#endif /* 0 */
       }
   
       free(threads);
  @@ -1436,7 +1445,7 @@
   
       if (idle_thread_count > max_spare_threads) {
           /* Kill off one child */
  -        ap_mpm_pod_signal(pod, TRUE);
  +        ap_mpm_pod_signal(pod);
           idle_spawn_rate = 1;
       }
       else if (idle_thread_count < min_spare_threads) {
  @@ -1666,7 +1675,7 @@
            * (By "gracefully" we don't mean graceful in the same sense as 
            * "apachectl graceful" where we allow old connections to finish.)
            */
  -        ap_mpm_pod_killpg(pod, ap_daemons_limit, FALSE);
  +        ap_mpm_pod_killpg(pod, ap_daemons_limit);
           ap_reclaim_child_processes(1);                /* Start with SIGTERM */
   
           if (!child_fatal) {
  @@ -1704,7 +1713,7 @@
           ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf,
                        AP_SIG_GRACEFUL_STRING " received.  Doing graceful restart");
           /* wake up the children...time to die.  But we'll have more soon */
  -        ap_mpm_pod_killpg(pod, ap_daemons_limit, TRUE);
  +        ap_mpm_pod_killpg(pod, ap_daemons_limit);
       
   
           /* This is mostly for debugging... so that we know what is still
  @@ -1717,7 +1726,7 @@
            * and a SIGHUP, we may as well use the same signal, because some user
            * pthreads are stealing signals from us left and right.
            */
  -        ap_mpm_pod_killpg(pod, ap_daemons_limit, FALSE);
  +        ap_mpm_pod_killpg(pod, ap_daemons_limit);
   
           ap_reclaim_child_processes(1);                /* Start with SIGTERM */
           ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf,
  
  
  
  1.3       +1 -1      httpd-2.0/server/mpm/experimental/leader/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/experimental/leader/Makefile.in,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Makefile.in	12 Apr 2002 04:24:44 -0000	1.2
  +++ Makefile.in	22 May 2002 01:04:59 -0000	1.3
  @@ -1,5 +1,5 @@
   
   LTLIBRARY_NAME    = libleader.la
  -LTLIBRARY_SOURCES = leader.c pod.c
  +LTLIBRARY_SOURCES = leader.c
   
   include $(top_srcdir)/build/ltlib.mk