You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ma...@locus.apache.org on 2000/07/30 14:03:48 UTC
cvs commit: apache-2.0/src/modules/mpm/prefork mpm.h
manoj 00/07/30 05:03:48
Modified: src/main mpm_common.c
src/modules/mpm/beos mpm.h
src/modules/mpm/dexter mpm.h
src/modules/mpm/mpmt_beos mpm.h
src/modules/mpm/mpmt_pthread mpm.h
src/modules/mpm/perchild mpm.h
src/modules/mpm/prefork mpm.h
Log:
Eliminate references to specific MPMs from mpm_common.c by having the
MPMs export interfaces to the tables used to keep track of children.
Revision Changes Path
1.30 +5 -20 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.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- mpm_common.c 2000/07/30 11:49:28 1.29
+++ mpm_common.c 2000/07/30 12:03:46 1.30
@@ -81,16 +81,7 @@
#include <sys/socket.h> /* for setsockopt prototype */
#endif
-#if defined(DEXTER_MPM) || defined(MPMT_BEOS_MPM) || defined(BEOS_MPM) || defined(PERCHILD_MPM)
-#define CHILD_TABLE 1
-#define CHILD_INFO_TABLE ap_child_table
-#elif defined(MPMT_PTHREAD) || defined(PREFORK_MPM)
-#define SCOREBOARD 1
-#define CHILD_INFO_TABLE ap_scoreboard_image->parent
-#endif
-
-
-#ifdef CHILD_INFO_TABLE
+#ifdef MPM_NEEDS_RECLAIM_CHILD_PROCESSES
void ap_reclaim_child_processes(int terminate)
{
int i;
@@ -100,9 +91,7 @@
int not_dead_yet;
int max_daemons = ap_get_max_daemons();
-#ifdef SCOREBOARD
- ap_sync_scoreboard_image();
-#endif
+ MPM_SYNC_CHILD_TABLE();
for (tries = terminate ? 4 : 1; tries <= 9; ++tries) {
/* don't want to hold up progress any more than
@@ -115,20 +104,16 @@
/* now see who is done */
not_dead_yet = 0;
for (i = 0; i < max_daemons; ++i) {
- pid_t pid = CHILD_INFO_TABLE[i].pid;
+ pid_t pid = MPM_CHILD_PID(i);
ap_proc_t proc;
-#ifdef CHILD_TABLE
if (pid == 0)
-#elif defined(SCOREBOARD)
- if (pid == ap_my_pid || pid == 0)
-#endif
continue;
proc.pid = pid;
waitret = ap_wait_proc(&proc, APR_NOWAIT);
if (waitret != APR_CHILD_NOTDONE) {
- CHILD_INFO_TABLE[i].pid = 0;
+ MPM_NOTE_CHILD_KILLED(i);
continue;
}
++not_dead_yet;
@@ -186,7 +171,7 @@
}
}
}
-#endif
+#endif /* NEED_RECLAIM_CHILD_PROCESSES */
/* number of calls to wait_or_timeout between writable probes */
#ifndef INTERVAL_OF_WRITABLE_PROBES
1.3 +6 -0 apache-2.0/src/modules/mpm/beos/mpm.h
Index: mpm.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/beos/mpm.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mpm.h 2000/07/10 18:21:19 1.2
+++ mpm.h 2000/07/30 12:03:46 1.3
@@ -60,6 +60,12 @@
#define APACHE_MPM_BEOS_H
#define BEOS_MPM
+
+#define MPM_NEEDS_RECLAIM_CHILD_PROCESSES 1
+#define MPM_SYNC_CHILD_TABLE()
+#define MPM_CHILD_PID(i) (ap_child_table[i].pid)
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
+
extern int ap_max_child_assigned;
#include "scoreboard.h"
1.4 +5 -0 apache-2.0/src/modules/mpm/dexter/mpm.h
Index: mpm.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/mpm.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mpm.h 2000/07/10 18:21:20 1.3
+++ mpm.h 2000/07/30 12:03:46 1.4
@@ -65,6 +65,11 @@
#define DEXTER_MPM
+#define MPM_NEEDS_RECLAIM_CHILD_PROCESSES 1
+#define MPM_SYNC_CHILD_TABLE()
+#define MPM_CHILD_PID(i) (ap_child_table[i].pid)
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
+
/* Table of child status */
#define SERVER_DEAD 0
#define SERVER_DYING 1
1.3 +5 -0 apache-2.0/src/modules/mpm/mpmt_beos/mpm.h
Index: mpm.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_beos/mpm.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mpm.h 2000/07/10 18:21:21 1.2
+++ mpm.h 2000/07/30 12:03:47 1.3
@@ -62,6 +62,11 @@
#define MPMT_BEOS_MPM
+#define MPM_NEEDS_RECLAIM_CHILD_PROCESSES 1
+#define MPM_SYNC_CHILD_TABLE()
+#define MPM_CHILD_PID(i) (ap_child_table[i].pid)
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
+
#define SERVER_DEAD 0
#define SERVER_DYING 1
#define SERVER_ALIVE 2
1.7 +5 -0 apache-2.0/src/modules/mpm/mpmt_pthread/mpm.h
Index: mpm.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpm.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- mpm.h 2000/07/22 03:38:57 1.6
+++ mpm.h 2000/07/30 12:03:47 1.7
@@ -63,6 +63,11 @@
#define MPMT_PTHREAD_MPM
+#define MPM_NEEDS_RECLAIM_CHILD_PROCESSES 1
+#define MPM_SYNC_CHILD_TABLE() (ap_sync_scoreboard_image())
+#define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
+
extern int ap_threads_per_child;
extern int ap_max_requests_per_child;
extern int ap_extended_status;
1.2 +5 -0 apache-2.0/src/modules/mpm/perchild/mpm.h
Index: mpm.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/perchild/mpm.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- mpm.h 2000/07/27 00:16:31 1.1
+++ mpm.h 2000/07/30 12:03:47 1.2
@@ -65,6 +65,11 @@
#define PERCHILD_MPM
+#define MPM_NEEDS_RECLAIM_CHILD_PROCESSES 1
+#define MPM_SYNC_CHILD_TABLE() (ap_sync_scoreboard_image())
+#define MPM_CHILD_PID(i) (ap_child_table[i].pid)
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
+
/* Table of child status */
#define SERVER_DEAD 0
#define SERVER_DYING 1
1.5 +5 -0 apache-2.0/src/modules/mpm/prefork/mpm.h
Index: mpm.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/mpm.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- mpm.h 2000/07/27 00:04:11 1.4
+++ mpm.h 2000/07/30 12:03:48 1.5
@@ -66,6 +66,11 @@
#define PREFORK_MPM
+#define MPM_NEEDS_RECLAIM_CHILD_PROCESSES 1
+#define MPM_SYNC_CHILD_TABLE() (ap_sync_scoreboard_image())
+#define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
+
extern int ap_max_daemons_limit;
extern scoreboard *ap_scoreboard_image;
extern server_rec *ap_server_conf;