httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: httpd-2.0/server/mpm/perchild mpm.h mpm_default.h perchild.c
Date Tue, 13 Feb 2001 03:26:25 GMT
rbb         01/02/12 19:26:24

  Modified:    .        CHANGES
               server/mpm/perchild mpm.h mpm_default.h perchild.c
  Log:
  Make perchild build again
  
  Revision  Changes    Path
  1.91      +2 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -u -d -b -w -u -r1.90 -r1.91
  --- CHANGES	2001/02/12 23:37:55	1.90
  +++ CHANGES	2001/02/13 03:26:23	1.91
  @@ -1,5 +1,7 @@
   Changes with Apache 2.0b1
   
  +  *) Get perchild building again. [Ryan Bloom]
  +
     *) Don't disable threads just because we are using the prefork MPM.
        If somebody wants to compile without threads, they must now add
        --disable-threads to the configure command line.  [Ryan Bloom]
  
  
  
  1.4       +1 -0      httpd-2.0/server/mpm/perchild/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/mpm.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -d -b -w -u -r1.3 -r1.4
  --- mpm.h	2000/07/31 01:39:54	1.3
  +++ mpm.h	2001/02/13 03:26:24	1.4
  @@ -80,6 +80,7 @@
       unsigned char status;
   } ap_ctable;
   
  +extern int ap_threads_per_child;
   extern int ap_max_daemons_limit;
   extern ap_ctable ap_child_table[HARD_SERVER_LIMIT];
   extern server_rec *ap_server_conf;
  
  
  
  1.6       +3 -0      httpd-2.0/server/mpm/perchild/mpm_default.h
  
  Index: mpm_default.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/mpm_default.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -d -b -w -u -r1.5 -r1.6
  --- mpm_default.h	2000/08/06 21:17:32	1.5
  +++ mpm_default.h	2001/02/13 03:26:24	1.6
  @@ -59,6 +59,9 @@
   #ifndef APACHE_MPM_DEFAULT_H
   #define APACHE_MPM_DEFAULT_H
   
  +#define AP_ID_FROM_CHILD_THREAD(c, t)    ((c * HARD_THREAD_LIMIT) + t)
  +#define AP_CHILD_THREAD_FROM_ID(i)    (i / HARD_THREAD_LIMIT), (i % HARD_THREAD_LIMIT)
  +
   /* Number of threads to spawn off by default --- also, if fewer than
    * this free when the caretaker checks, it will spawn more.
    */
  
  
  
  1.45      +13 -21    httpd-2.0/server/mpm/perchild/perchild.c
  
  Index: perchild.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -d -b -w -u -r1.44 -r1.45
  --- perchild.c	2001/02/11 03:27:21	1.44
  +++ perchild.c	2001/02/13 03:26:24	1.45
  @@ -116,7 +116,6 @@
   static int max_threads = 0;
   static int max_requests_per_child = 0;
   static const char *ap_pid_fname=NULL;
  -AP_DECLARE_DATA const char *ap_scoreboard_fname=NULL;
   static int num_daemons=0;
   static int curr_child_num=0;
   static int workers_may_exit = 0;
  @@ -159,6 +158,7 @@
    * many child processes in this MPM.
    */
   int ap_max_daemons_limit = -1;
  +int ap_threads_per_child = HARD_THREAD_LIMIT;
   
   char ap_coredump_dir[MAX_STRING_LEN];
   
  @@ -559,6 +559,9 @@
       pthread_mutex_unlock(&thread_pool_parent_mutex);
       apr_pool_create(&ptrans, tpool);
   
  +    (void) ap_update_child_status(child_num, thread_num, SERVER_STARTING,
  +                                  (request_rec *) NULL);
  +
       apr_poll_setup(&pollset, num_listenfds+1, tpool);
       for(n=0 ; n <= num_listenfds ; ++n) {
           apr_poll_socket_add(pollset, listenfds[n], APR_POLLIN);
  @@ -581,6 +584,10 @@
           else {
               thread_just_started = 0;
           }
  +
  +        (void) ap_update_child_status(child_num, thread_num, SERVER_READY,
  +                                      (request_rec *) NULL);
  +
           pthread_mutex_lock(&thread_accept_mutex);
           if (workers_may_exit) {
               pthread_mutex_unlock(&thread_accept_mutex);
  @@ -728,6 +735,8 @@
       }
   
       pthread_mutex_lock(&thread_pool_parent_mutex);
  +    ap_update_child_status(child_num, thread_num, SERVER_DEAD,
  +                           (request_rec *) NULL);
       apr_pool_destroy(tpool);
       pthread_mutex_unlock(&thread_pool_parent_mutex);
       pthread_mutex_lock(&worker_thread_count_mutex);
  @@ -946,6 +955,7 @@
           ap_child_table[slot].status = SERVER_ALIVE;
   	child_main(slot);
       }
  +    (void) ap_update_child_status(slot, 0, SERVER_STARTING, (request_rec *) NULL);
   
       if ((pid = fork()) == -1) {
           ap_log_error(APLOG_MARK, APLOG_ERR, errno, s,
  @@ -1080,17 +1090,14 @@
               child_slot = -1;
               for (i = 0; i < ap_max_daemons_limit; ++i) {
           	if (ap_child_table[i].pid == pid.pid) {
  -                    int j;
  -
                       child_slot = i;
  -                    for (j = 0; j < HARD_THREAD_LIMIT; j++) {
  -                        ap_perchild_force_reset_connection_status(i * HARD_THREAD_LIMIT
+ j);
  -                    }
                       break;
                   }
               }
               if (child_slot >= 0) {
                   ap_child_table[child_slot].pid = 0;
  +                ap_update_child_status(child_slot, i, SERVER_DEAD, (request_rec *) NULL);
  +
                   
   		if (remaining_children_to_start
   		    && child_slot < num_daemons) {
  @@ -1331,7 +1338,6 @@
       ap_scoreboard_fname = DEFAULT_SCOREBOARD;
       lock_fname = DEFAULT_LOCKFILE;
       max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
  -    ap_perchild_set_maintain_connection_status(1);
       curr_child_num = 0;
   
       apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));
  @@ -1703,18 +1709,6 @@
       return NULL;
   }
   
  -static const char *set_maintain_connection_status(cmd_parms *cmd,
  -                                                  void *dummy, int arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    ap_perchild_set_maintain_connection_status(arg != 0);
  -    return NULL;
  -}
  -
   static const char *set_coredumpdir (cmd_parms *cmd, void *dummy,
   				    const char *arg) 
   {
  @@ -1806,8 +1800,6 @@
                 "Maximum number of threads per child"),
   AP_INIT_TAKE1("MaxRequestsPerChild", set_max_requests, NULL, RSRC_CONF,
                 "Maximum number of requests a particular child serves before dying."),
  -AP_INIT_FLAG("ConnectionStatus", set_maintain_connection_status, NULL, RSRC_CONF,
  -             "Whether or not to maintain status information on current connections"),
   AP_INIT_TAKE1("CoreDumpDirectory", set_coredumpdir, NULL, RSRC_CONF,
                 "The location of the directory Apache changes to before dumping core"),
   AP_INIT_TAKE3("ChildperUserID", set_child_per_uid, NULL, RSRC_CONF,
  
  
  

Mime
View raw message