httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/mpm/perchild perchild.c
Date Sun, 30 Jul 2000 11:49:30 GMT
manoj       00/07/30 04:49:30

  Modified:    src/main mpm_common.c
               src/modules/mpm/beos beos.c
               src/modules/mpm/dexter dexter.c
               src/modules/mpm/mpmt_beos mpmt_beos.c
               src/modules/mpm/perchild perchild.c
  Log:
  Change semantics of ap_child_table somewhat. Instead of checking for a
  dead process with status == SERVER_DEAD, check with pid == 0. This
  makes somewhat more sense conceptually, and also matches the behavior
  of MPMs that use a shmem scoreboard to track children.
  
  Revision  Changes    Path
  1.29      +2 -6      apache-2.0/src/main/mpm_common.c
  
  Index: mpm_common.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/mpm_common.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- mpm_common.c	2000/07/27 00:16:31	1.28
  +++ mpm_common.c	2000/07/30 11:49:28	1.29
  @@ -119,7 +119,7 @@
               ap_proc_t proc;
   
   #ifdef CHILD_TABLE
  -            if (ap_child_table[i].status == SERVER_DEAD)
  +            if (pid == 0)
   #elif defined(SCOREBOARD)
               if (pid == ap_my_pid || pid == 0)
   #endif
  @@ -128,11 +128,7 @@
               proc.pid = pid;
               waitret = ap_wait_proc(&proc, APR_NOWAIT);
               if (waitret != APR_CHILD_NOTDONE) {
  -#ifdef CHILD_TABLE
  -                ap_child_table[i].status = SERVER_DEAD;
  -#elif defined(SCOREBOARD)
  -                ap_scoreboard_image->parent[i].pid = 0;
  -#endif
  +                CHILD_INFO_TABLE[i].pid = 0;
                   continue;
               }
               ++not_dead_yet;
  
  
  
  1.15      +4 -4      apache-2.0/src/modules/mpm/beos/beos.c
  
  Index: beos.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/beos/beos.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- beos.c	2000/07/29 16:24:11	1.14
  +++ beos.c	2000/07/30 11:49:28	1.15
  @@ -237,7 +237,7 @@
       int i, code = 99;
   
       for (i=0;i<ap_max_child_assigned;i++) {
  -        if (ap_child_table[i].status != SERVER_DEAD)
  +        if (ap_child_table[i].pid)
               write_port(port_of_death, code, NULL, 0);
       }
   }
  @@ -520,7 +520,7 @@
       int i;
   
       for (i = 0; number_to_start && i < ap_thread_limit; ++i) {
  -	if (ap_child_table[i].status  != SERVER_DEAD) {
  +	if (ap_child_table[i].pid) {
   	    continue;
   	}
   	if (make_worker(ap_server_conf, i, 0) < 0) {
  @@ -555,7 +555,7 @@
       free_length = 0;
   
       for (i = 0; i < ap_thread_limit; ++i) {
  -        if (ap_child_table[i].status == SERVER_DEAD) {
  +        if (ap_child_table[i].pid == 0) {
               if (free_length < spawn_rate) {
                   free_slots[free_length] = i;
                   ++free_length;
  @@ -614,7 +614,7 @@
                   }
               }
               if (child_slot >= 0) {
  -                ap_child_table[child_slot].status = SERVER_DEAD;
  +                ap_child_table[child_slot].pid = 0;
                   
   		if (remaining_threads_to_start
   		    && child_slot < ap_thread_limit) {
  
  
  
  1.117     +5 -5      apache-2.0/src/modules/mpm/dexter/dexter.c
  
  Index: dexter.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.c,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- dexter.c	2000/07/29 16:24:11	1.116
  +++ dexter.c	2000/07/30 11:49:28	1.117
  @@ -819,7 +819,7 @@
       int i;
   
       for (i = 0; number_to_start && i < num_daemons; ++i) {
  -	if (ap_child_table[i].status != SERVER_DEAD) {
  +	if (ap_child_table[i].pid) {
   	    continue;
   	}
   	if (make_child(ap_server_conf, i, 0) < 0) {
  @@ -855,7 +855,7 @@
       free_length = 0;
       
       for (i = 0; i < num_daemons; ++i) {
  -        if (ap_child_table[i].status == SERVER_DEAD) {
  +        if (ap_child_table[i].pid == 0) {
               if (free_length < spawn_rate) {
                   free_slots[free_length] = i;
                   ++free_length;
  @@ -917,7 +917,7 @@
                   }
               }
               if (child_slot >= 0) {
  -                ap_child_table[child_slot].status = SERVER_DEAD;
  +                ap_child_table[child_slot].pid = 0;
                   
   		if (remaining_children_to_start
   		    && child_slot < num_daemons) {
  @@ -1017,7 +1017,7 @@
       /* Initialize the child table */
       if (!is_graceful) {
           for (i = 0; i < HARD_SERVER_LIMIT; i++) {
  -            ap_child_table[i].status = SERVER_DEAD;
  +            ap_child_table[i].pid = 0;
           }
       }
   
  @@ -1097,7 +1097,7 @@
            */
   	
   	for (i = 0; i < num_daemons; ++i) {
  -	    if (ap_child_table[i].status != SERVER_DEAD) {
  +	    if (ap_child_table[i].pid) {
   	        ap_child_table[i].status = SERVER_DYING;
   	    } 
   	}
  
  
  
  1.44      +4 -4      apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c
  
  Index: mpmt_beos.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- mpmt_beos.c	2000/07/29 16:24:12	1.43
  +++ mpmt_beos.c	2000/07/30 11:49:29	1.44
  @@ -553,7 +553,7 @@
       int i;
   
       for (i = 0; number_to_start && i < ap_daemons_limit; ++i) {
  -	if (ap_child_table[i].status  != SERVER_DEAD) {
  +	if (ap_child_table[i].pid) {
   	    continue;
   	}
   	if (make_child(ap_server_conf, i, 0) < 0) {
  @@ -588,7 +588,7 @@
       free_length = 0;
   
       for (i = 0; i < ap_daemons_limit; ++i) {
  -        if (ap_child_table[i].status == SERVER_DEAD) {
  +        if (ap_child_table[i].pid == 0) {
               if (free_length < spawn_rate) {
                   free_slots[free_length] = i;
                   ++free_length;
  @@ -647,7 +647,7 @@
                   }
               }
               if (child_slot >= 0) {
  -                ap_child_table[child_slot].status = SERVER_DEAD;
  +                ap_child_table[child_slot].pid = 0;
                   
   		if (remaining_children_to_start
   		    && child_slot < ap_daemons_limit) {
  @@ -807,7 +807,7 @@
   
   	/* give the children the signal to die */
           for (i = 0; i < ap_daemons_limit;) {
  -            if(ap_child_table[i].status != SERVER_DEAD) {
  +            if(ap_child_table[i].pid) {
                   if (write_port(port_of_death, 99, &char_of_death, 1) != B_OK) {
                       if (errno == EINTR) continue;
                       ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf,
  
  
  
  1.7       +5 -5      apache-2.0/src/modules/mpm/perchild/perchild.c
  
  Index: perchild.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/perchild/perchild.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- perchild.c	2000/07/29 16:24:13	1.6
  +++ perchild.c	2000/07/30 11:49:29	1.7
  @@ -985,7 +985,7 @@
       int i;
   
       for (i = 0; number_to_start && i < num_daemons; ++i) {
  -	if (ap_child_table[i].status != SERVER_DEAD) {
  +	if (ap_child_table[i].pid) {
   	    continue;
   	}
   	if (make_child(ap_server_conf, i, 0) < 0) {
  @@ -1021,7 +1021,7 @@
       free_length = 0;
       
       for (i = 0; i < num_daemons; ++i) {
  -        if (ap_child_table[i].status == SERVER_DEAD) {
  +        if (ap_child_table[i].pid == 0) {
               if (free_length < spawn_rate) {
                   free_slots[free_length] = i;
                   ++free_length;
  @@ -1083,7 +1083,7 @@
                   }
               }
               if (child_slot >= 0) {
  -                ap_child_table[child_slot].status = SERVER_DEAD;
  +                ap_child_table[child_slot].pid = 0;
                   
   		if (remaining_children_to_start
   		    && child_slot < num_daemons) {
  @@ -1183,7 +1183,7 @@
       /* Initialize the child table */
       if (!is_graceful) {
           for (i = 0; i < HARD_SERVER_LIMIT; i++) {
  -            ap_child_table[i].status = SERVER_DEAD;
  +            ap_child_table[i].pid = 0;
           }
       }
   
  @@ -1263,7 +1263,7 @@
            */
   	
   	for (i = 0; i < num_daemons; ++i) {
  -	    if (ap_child_table[i].status != SERVER_DEAD) {
  +	    if (ap_child_table[i].pid) {
   	        ap_child_table[i].status = SERVER_DYING;
   	    } 
   	}
  
  
  

Mime
View raw message