httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/beos beos.c
Date Wed, 10 Mar 2004 00:28:30 GMT
dreid       2004/03/09 16:28:30

  Modified:    server/mpm/beos Tag: APACHE_2_0_BRANCH beos.c
  Log:
  This patch is Jeff's APMPMQ_MPM_STATE
  patch for the beos mpm. It isn't quite as all encompassing as
  Jeff's but at least it provides the basics until experience
  can be gained in how it performs.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.99.2.6  +17 -1     httpd-2.0/server/mpm/beos/beos.c
  
  Index: beos.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/beos/beos.c,v
  retrieving revision 1.99.2.5
  retrieving revision 1.99.2.6
  diff -u -r1.99.2.5 -r1.99.2.6
  --- beos.c	9 Feb 2004 20:59:47 -0000	1.99.2.5
  +++ beos.c	10 Mar 2004 00:28:30 -0000	1.99.2.6
  @@ -95,6 +95,7 @@
   static apr_pool_t *pchild;		/* Pool for httpd child stuff */
   
   static int server_pid; 
  +static int mpm_state = AP_MPMQ_STARTING;
   
   /* Keep track of the number of worker threads currently active */
   static int worker_thread_count;
  @@ -186,6 +187,8 @@
   
   static void ap_start_shutdown(void)
   {
  +    mpm_state = AP_MPMQ_STOPPING;
  + 
       if (shutdown_pending == 1) {
   	/* Um, is this _probably_ not an error, if the user has
   	 * tried to do a shutdown twice quickly, so we won't
  @@ -199,6 +202,7 @@
   /* do a graceful restart if graceful == 1 */
   static void ap_start_restart(int graceful)
   {
  +    mpm_state = AP_MPMQ_STOPPING;
   
       if (restart_pending == 1) {
           /* Probably not an error - don't bother reporting it */
  @@ -222,6 +226,9 @@
   {
       apr_size_t len;
       int i = 0;
  +
  +    mpm_state = AP_MPMQ_STOPPING;
  +
       for (i = 0 ; i < ap_max_child_assigned; i++){
           len = 4;
           if (apr_sendto(udp_sock, udp_sa, 0, "die!", &len) != APR_SUCCESS)
  @@ -334,6 +341,8 @@
       int this_worker_should_exit = 0; 
       free(ti);
   
  +    mpm_state = AP_MPMQ_STARTING;
  +
       on_exit_thread(check_restart, (void*)child_slot);
             
       /* block the signals for this thread */
  @@ -360,6 +369,8 @@
       for(n=0 ; n <= num_listening_sockets ; n++)
           apr_poll_socket_add(pollset, listening_sockets[n], APR_POLLIN);
   
  +    mpm_state = AP_MPMQ_RUNNING;
  +
       while (1) {
           /* If we're here, then chances are (unless we're the first thread created) 
            * we're going to be held up in the accept mutex, so doing this here
  @@ -720,6 +731,9 @@
           case AP_MPMQ_MAX_DAEMONS:
               *result = HARD_SERVER_LIMIT;
               return APR_SUCCESS;
  +        case AP_MPMQ_MPM_STATE:
  +            *result = mpm_state;
  +            return APR_SUCCESS;
       }
       return APR_ENOTIMPL;
   }
  @@ -966,6 +980,8 @@
       int no_detach, debug, foreground;
       apr_status_t rv;
   
  +    mpm_state = AP_MPMQ_STARTING;
  +
       debug = ap_exists_config_define("DEBUG");
   
       if (debug) {
  @@ -1017,7 +1033,7 @@
   {
       one_process = 0;
       
  -    ap_hook_pre_config(beos_pre_config, NULL, NULL, APR_HOOK_MIDDLE); 
  +    ap_hook_pre_config(beos_pre_config, NULL, NULL, APR_HOOK_REALLY_FIRST); 
   }
   
   static const char *set_threads_to_start(cmd_parms *cmd, void *dummy, const char *arg) 
  
  
  

Mime
View raw message