httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/mpm/prefork prefork.c
Date Fri, 19 May 2000 01:05:28 GMT
rbb         00/05/18 18:05:27

  Modified:    src/main mpm_common.c
               src/modules/mpm/dexter dexter.c
               src/modules/mpm/mpmt_pthread mpmt_pthread.c
               src/modules/mpm/prefork prefork.c
  Log:
  Move wait_or_timeout from the MPM's into the new mpm_common.c file.  I
  also renamed wait_or_timeout to ap_wait_or_timeout for namespace
  protection.
  
  Revision  Changes    Path
  1.2       +37 -0     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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mpm_common.c	2000/05/18 23:24:58	1.1
  +++ mpm_common.c	2000/05/19 01:05:17	1.2
  @@ -167,4 +167,41 @@
       }
   }
   
  +/* number of calls to wait_or_timeout between writable probes */
  +#ifndef INTERVAL_OF_WRITABLE_PROBES
  +#define INTERVAL_OF_WRITABLE_PROBES 10
  +#endif
  +static int wait_or_timeout_counter;
  +
  +static ap_proc_t *ap_wait_or_timeout(ap_wait_t *status, ap_pool_t *p)
  +{
  +    struct timeval tv;
  +    ap_status_t rv;
  +    ap_proc_t *ret = NULL;
  +
  +    ++wait_or_timeout_counter;
  +    if (wait_or_timeout_counter == INTERVAL_OF_WRITABLE_PROBES) {
  +        wait_or_timeout_counter = 0;
  +#ifdef APR_HAS_OTHER_CHILD
  +        ap_probe_writable_fds();
  +#endif
  +    }
  +    rv = ap_wait_all_procs(&ret, status, APR_NOWAIT, p);
  +    if (ap_canonical_error(rv) == APR_EINTR) {
  +        return NULL;
  +    }
  +    if (rv == APR_CHILD_DONE) {
  +        return ret;
  +    }
  +#ifdef NEED_WAITPID
  +    if ((ret = reap_children(status)) > 0) {
  +        return ret;
  +    }
  +#endif
  +    tv.tv_sec = SCOREBOARD_MAINTENANCE_INTERVAL / 1000000;
  +    tv.tv_usec = SCOREBOARD_MAINTENANCE_INTERVAL % 1000000;
  +    ap_select(0, NULL, NULL, NULL, &tv);
  +    return NULL;
  +}
  +
   
  
  
  
  1.80      +1 -37     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.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- dexter.c	2000/05/18 23:24:59	1.79
  +++ dexter.c	2000/05/19 01:05:22	1.80
  @@ -180,42 +180,6 @@
       exit(code);
   }
   
  -/* Finally, this routine is used by the caretaker process to wait for
  - * a while...
  - */
  -
  -/* number of calls to wait_or_timeout between writable probes */
  -#ifndef INTERVAL_OF_WRITABLE_PROBES
  -#define INTERVAL_OF_WRITABLE_PROBES 10
  -#endif
  -static int wait_or_timeout_counter;
  -
  -static ap_proc_t *wait_or_timeout(ap_wait_t *status, ap_pool_t *p)
  -{
  -    struct timeval tv;
  -    ap_status_t rv;
  -    ap_proc_t *ret = NULL;
  -
  -    ++wait_or_timeout_counter;
  -    if (wait_or_timeout_counter == INTERVAL_OF_WRITABLE_PROBES) {
  -        wait_or_timeout_counter = 0;
  -#ifdef APR_HAS_OTHER_CHILD
  -        ap_probe_writable_fds();
  -#endif
  -    }
  -    rv = ap_wait_all_procs(&ret, status, APR_NOWAIT, p);
  -    if (ap_canonical_error(rv) == APR_EINTR) {
  -        return NULL;
  -    }
  -    if (rv == APR_CHILD_DONE) {
  -        return ret;
  -    }
  -    tv.tv_sec = SCOREBOARD_MAINTENANCE_INTERVAL / 1000000;
  -    tv.tv_usec = SCOREBOARD_MAINTENANCE_INTERVAL % 1000000;
  -    ap_select(0, NULL, NULL, NULL, &tv);
  -    return NULL;
  -}
  -
   /* handle all varieties of core dumping signals */
   static void sig_coredump(int sig)
   {
  @@ -1014,7 +978,7 @@
       int i;
   
       while (!restart_pending && !shutdown_pending) {
  -        pid = wait_or_timeout(&status, pconf);
  +        pid = ap_wait_or_timeout(&status, pconf);
           
           if (pid != NULL) {
               int actual_pid;
  
  
  
  1.73      +1 -42     apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c
  
  Index: mpmt_pthread.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- mpmt_pthread.c	2000/05/18 23:25:02	1.72
  +++ mpmt_pthread.c	2000/05/19 01:05:25	1.73
  @@ -184,47 +184,6 @@
       exit(code);
   }
   
  -/* Finally, this routine is used by the caretaker process to wait for
  - * a while...
  - */
  -
  -/* number of calls to wait_or_timeout between writable probes */
  -#ifndef INTERVAL_OF_WRITABLE_PROBES
  -#define INTERVAL_OF_WRITABLE_PROBES 10
  -#endif
  -static int wait_or_timeout_counter;
  -
  -static ap_proc_t *wait_or_timeout(ap_wait_t *status, ap_pool_t *p)
  -{
  -    struct timeval tv;
  -    ap_status_t rv;
  -    ap_proc_t *ret = NULL;
  -
  -    ++wait_or_timeout_counter;
  -    if (wait_or_timeout_counter == INTERVAL_OF_WRITABLE_PROBES) {
  -        wait_or_timeout_counter = 0;
  -#ifdef APR_HAS_OTHER_CHILD
  -        ap_probe_writable_fds();
  -#endif
  -    }
  -    rv = ap_wait_all_procs(&ret, status, APR_NOWAIT, p);
  -    if (ap_canonical_error(rv) == APR_EINTR) {
  -        return NULL;
  -    }
  -    if (rv == APR_CHILD_DONE) {
  -        return ret;
  -    }
  -#ifdef NEED_WAITPID
  -    if ((ret = reap_children(status)) > 0) {
  -        return ret;
  -    }
  -#endif
  -    tv.tv_sec = SCOREBOARD_MAINTENANCE_INTERVAL / 1000000;
  -    tv.tv_usec = SCOREBOARD_MAINTENANCE_INTERVAL % 1000000;
  -    ap_select(0, NULL, NULL, NULL, &tv);
  -    return NULL;
  -}
  -
   /* handle all varieties of core dumping signals */
   static void sig_coredump(int sig)
   {
  @@ -1061,7 +1020,7 @@
   
       while (!restart_pending && !shutdown_pending) {
           /* this is a memory leak, but I'll fix it later. */
  -        pid = wait_or_timeout(&status, pconf);
  +        pid = ap_wait_or_timeout(&status, pconf);
           
           if (pid != NULL) {
               process_child_status(pid, status);
  
  
  
  1.87      +1 -42     apache-2.0/src/modules/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- prefork.c	2000/05/18 23:25:06	1.86
  +++ prefork.c	2000/05/19 01:05:26	1.87
  @@ -1051,47 +1051,6 @@
   }
   #endif
   
  -/* Finally, this routine is used by the caretaker process to wait for
  - * a while...
  - */
  -
  -/* number of calls to wait_or_timeout between writable probes */
  -#ifndef INTERVAL_OF_WRITABLE_PROBES
  -#define INTERVAL_OF_WRITABLE_PROBES 10
  -#endif
  -static int wait_or_timeout_counter;
  -
  -static ap_proc_t *wait_or_timeout(ap_wait_t *status, ap_pool_t *p)
  -{
  -    struct timeval tv;
  -    ap_status_t rv;
  -    ap_proc_t *ret = NULL;
  -
  -    ++wait_or_timeout_counter;
  -    if (wait_or_timeout_counter == INTERVAL_OF_WRITABLE_PROBES) {
  -	wait_or_timeout_counter = 0;
  -#ifdef APR_HAS_OTHER_CHILD
  -	ap_probe_writable_fds();
  -#endif
  -    }
  -    rv = ap_wait_all_procs(&ret, status, APR_NOWAIT, p);
  -    if (ap_canonical_error(rv) == APR_EINTR) {
  -	return NULL;
  -    }
  -    if (rv == APR_CHILD_DONE) {
  -	return ret;
  -    }
  -#ifdef NEED_WAITPID
  -    if ((ret = reap_children(status)) > 0) {
  -	return ret;
  -    }
  -#endif
  -    tv.tv_sec = SCOREBOARD_MAINTENANCE_INTERVAL / 1000000;
  -    tv.tv_usec = SCOREBOARD_MAINTENANCE_INTERVAL % 1000000;
  -    ap_select(0, NULL, NULL, NULL, &tv);
  -    return NULL;
  -}
  -
   /* handle all varieties of core dumping signals */
   static void sig_coredump(int sig)
   {
  @@ -2000,7 +1959,7 @@
   	int child_slot;
   	ap_wait_t status;
           /* this is a memory leak, but I'll fix it later. */
  -	ap_proc_t *pid = wait_or_timeout(&status, pconf);
  +	ap_proc_t *pid = ap_wait_or_timeout(&status, pconf);
   
   	/* XXX: if it takes longer than 1 second for all our children
   	 * to start up and get into IDLE state then we may spawn an
  
  
  

Mime
View raw message