httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: httpd-2.0/server/mpm/spmt_os2 spmt_os2.c
Date Wed, 07 Feb 2001 23:25:35 GMT
bjh         01/02/07 15:25:34

  Modified:    include  scoreboard.h
               server/mpm/spmt_os2 spmt_os2.c
  Log:
  Move OS/2 MPM specific variables out of scoreboard & into an array local to
  the MPM.
  
  Revision  Changes    Path
  1.9       +0 -5      httpd-2.0/include/scoreboard.h
  
  Index: scoreboard.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/scoreboard.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- scoreboard.h	2001/02/07 20:49:23	1.8
  +++ scoreboard.h	2001/02/07 23:25:27	1.9
  @@ -173,11 +173,6 @@
   #ifndef OPTIMIZE_TIMEOUTS
       time_t last_used;
   #endif
  -#ifdef SPMT_OS2_MPM
  -    apr_wait_t thread_retval;
  -    char deferred_die;
  -    ap_generation_t generation;	/* generation of this thread */
  -#endif
       char client[32];		/* Keep 'em small... */
       char request[64];		/* We just want an idea... */
       server_rec *vhostrec;	/* What virtual host is being accessed? */
  
  
  
  1.80      +19 -11    httpd-2.0/server/mpm/spmt_os2/spmt_os2.c
  
  Index: spmt_os2.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/spmt_os2/spmt_os2.c,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- spmt_os2.c	2001/02/07 13:17:32	1.79
  +++ spmt_os2.c	2001/02/07 23:25:31	1.80
  @@ -132,6 +132,11 @@
   
   #define THREAD_GLOBAL(gvar) ((*ppthread_globals)->gvar)
   
  +struct thread_control_t {
  +    apr_wait_t thread_retval;
  +    char deferred_die;
  +    ap_generation_t generation;	/* generation of this thread */
  +} thread_control[HARD_THREAD_LIMIT];
   
   /* a clean exit from a child with proper cleanup */
   static void clean_child_exit(int code)
  @@ -140,7 +145,8 @@
           apr_destroy_pool(THREAD_GLOBAL(pchild));
       }
   
  -    ap_scoreboard_image->servers[0][THREAD_GLOBAL(thread_num)].thread_retval = code;
  +    thread_control[THREAD_GLOBAL(thread_num)].deferred_die = 0;
  +    thread_control[THREAD_GLOBAL(thread_num)].thread_retval = code;
       _endthread();
   }
   
  @@ -257,7 +263,7 @@
       if (ret == 0) {
           int thread_num = find_thread_by_tid(tid);
           ap_assert( thread_num > 0 );
  -        *status = ap_scoreboard_image->servers[0][thread_num].thread_retval;
  +        *status = thread_control[thread_num].thread_retval;
   	return tid;
       }
       
  @@ -428,7 +434,7 @@
       if (THREAD_GLOBAL(usr1_just_die)) {
   	just_die(sig);
       }
  -    ap_scoreboard_image->servers[0][THREAD_GLOBAL(thread_num)].deferred_die = 1;
  +    thread_control[THREAD_GLOBAL(thread_num)].deferred_die = 1;
   }
   
   /* volatile just in case */
  @@ -568,15 +574,15 @@
   AP_DECLARE(void) ap_child_terminate(request_rec *r)
   {
       r->connection->keepalive = 0;
  -    ap_scoreboard_image->servers[0][THREAD_GLOBAL(thread_num)].deferred_die = 1;
  +    thread_control[THREAD_GLOBAL(thread_num)].deferred_die = 1;
   }
   
   
   
   int ap_graceful_stop_signalled(void)
   {
  -    if (ap_scoreboard_image->servers[0][THREAD_GLOBAL(thread_num)].deferred_die ||
  -	ap_scoreboard_image->global.running_generation != ap_scoreboard_image->servers[0][THREAD_GLOBAL(thread_num)].generation)
{
  +    if (thread_control[THREAD_GLOBAL(thread_num)].deferred_die ||
  +	ap_scoreboard_image->global.running_generation != thread_control[THREAD_GLOBAL(thread_num)].generation)
{
   	return 1;
       }
       return 0;
  @@ -587,8 +593,8 @@
   int ap_stop_signalled(void)
   {
       if (shutdown_pending || restart_pending ||
  -        ap_scoreboard_image->servers[0][THREAD_GLOBAL(thread_num)].deferred_die ||
  -	ap_scoreboard_image->global.running_generation != ap_scoreboard_image->servers[0][THREAD_GLOBAL(thread_num)].generation)
{
  +        thread_control[THREAD_GLOBAL(thread_num)].deferred_die ||
  +	ap_scoreboard_image->global.running_generation != thread_control[THREAD_GLOBAL(thread_num)].generation)
{
   	return 1;
       }
       return 0;
  @@ -872,6 +878,7 @@
       }
   
       ap_scoreboard_image->servers[0][slot].tid = tid;
  +    thread_control[THREAD_GLOBAL(thread_num)].generation = ap_scoreboard_image->global.running_generation;
       return 0;
   }
   
  @@ -966,7 +973,7 @@
   	 * shut down gracefully, in case it happened to pick up a request
   	 * while we were counting
   	 */
  -	ap_scoreboard_image->servers[0][to_kill].deferred_die = 1;
  +	thread_control[to_kill].deferred_die = 1;
   	idle_spawn_rate = 1;
       }
       else if (idle_count < ap_daemons_min_free) {
  @@ -1035,7 +1042,8 @@
       SAFE_ACCEPT(accept_mutex_init(pconf));
   
       if (!is_graceful) {
  -	ap_create_scoreboard(pconf, SB_NOT_SHARED);
  +        ap_create_scoreboard(pconf, SB_NOT_SHARED);
  +        memset(thread_control, 0, sizeof(thread_control));
       }
   
       set_signals();
  @@ -1218,7 +1226,7 @@
   
           /* kill off the idle ones */
           for (i = 0; i < ap_daemons_limit; ++i) {
  -            ap_scoreboard_image->servers[0][i].deferred_die = 1;
  +            thread_control[i].deferred_die = 1;
           }
   
   	/* This is mostly for debugging... so that we know what is still
  
  
  

Mime
View raw message