gozer       2004/09/17 21:33:34

  Modified:    src/modules/perl mod_perl.c mod_perl.h modperl_config.c
                        modperl_interp.c modperl_types.h
  Log:
  Get rid of the threaded_mpm member from modperl_config_srv_t. Use a
  global instead.
  
  Revision  Changes    Path
  1.221     +11 -8     modperl-2.0/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
  retrieving revision 1.220
  retrieving revision 1.221
  diff -u -r1.220 -r1.221
  --- mod_perl.c        7 Aug 2004 02:52:08 -0000       1.220
  +++ mod_perl.c        18 Sep 2004 04:33:34 -0000      1.221
  @@ -35,6 +35,13 @@
       return MP_threads_started;
   }
   
  +static int MP_threaded_mpm = 0;
  +
  +int modperl_threaded_mpm(void)
  +{
  +    return MP_threaded_mpm;
  +}
  +
   #ifndef USE_ITHREADS
   static apr_status_t modperl_shutdown(void *data)
   {
  @@ -397,7 +404,7 @@
                                      base_server->server_hostname));
   
   #ifndef USE_ITHREADS
  -    if (base_scfg->threaded_mpm) {
  +    if (modperl_threaded_mpm()) {
           ap_log_error(APLOG_MARK, APLOG_ERR, 0, base_server,
                        "cannot use threaded MPM without ithreads enabled Perl");
           exit(1);
  @@ -428,7 +435,7 @@
       char *base_name = modperl_server_desc(s, p);
   #endif /* MP_TRACE */
   
  -    if (!base_scfg->threaded_mpm) {
  +    if (!modperl_threaded_mpm()) {
           MP_TRACE_i(MP_FUNC, "no clones created for non-threaded mpm\n");
           return;
       }
  @@ -469,13 +476,11 @@
   
   void modperl_init_globals(server_rec *s, apr_pool_t *pconf)
   {
  -    int threaded_mpm;
  -    ap_mpm_query(AP_MPMQ_IS_THREADED, &threaded_mpm);
  +    ap_mpm_query(AP_MPMQ_IS_THREADED, &MP_threaded_mpm);
   
       MP_TRACE_g(MP_FUNC, "mod_perl globals are configured\n");
       
       modperl_global_init_pconf(pconf, pconf);
  -    modperl_global_init_threaded_mpm(pconf, threaded_mpm);
       modperl_global_init_server_rec(pconf, s);
   
       modperl_tls_create_request_rec(pconf);
  @@ -627,11 +632,9 @@
   static int modperl_hook_post_config_last(apr_pool_t *pconf, apr_pool_t *plog,
                                            apr_pool_t *ptemp, server_rec *s)
   {
  -    MP_dSCFG(s);
  -
       /* in the threaded environment, no server_rec/process_rec
        * modifications should be done beyond this point */
  -    if (scfg->threaded_mpm) {
  +    if (modperl_threaded_mpm()) {
           MP_threads_started = 1;
       }
       
  
  
  
  1.69      +1 -0      modperl-2.0/src/modules/perl/mod_perl.h
  
  Index: mod_perl.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.h,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- mod_perl.h        10 Jul 2004 00:36:19 -0000      1.68
  +++ mod_perl.h        18 Sep 2004 04:33:34 -0000      1.69
  @@ -94,6 +94,7 @@
   #include "modperl_debug.h"
   
   int modperl_threads_started(void);
  +int modperl_threaded_mpm(void);
   
   #define MP_CROAK_IF_THREADS_STARTED(what)                       \
       if (modperl_threads_started()) {                            \
  
  
  
  1.82      +0 -3      modperl-2.0/src/modules/perl/modperl_config.c
  
  Index: modperl_config.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- modperl_config.c  9 Sep 2004 22:39:11 -0000       1.81
  +++ modperl_config.c  18 Sep 2004 04:33:34 -0000      1.82
  @@ -260,8 +260,6 @@
   {
       modperl_config_srv_t *scfg = modperl_config_srv_new(p);
   
  -    ap_mpm_query(AP_MPMQ_IS_THREADED, &scfg->threaded_mpm);
  -
       if (!s->is_virtual) {
   
           /* give a chance to MOD_PERL_TRACE env var to set
  @@ -335,7 +333,6 @@
       mrg->setvars = add->setvars;
       mrg->addvars = add->addvars;
   
  -    merge_item(threaded_mpm);
       merge_item(server);
   
   #ifdef USE_ITHREADS
  
  
  
  1.63      +3 -3      modperl-2.0/src/modules/perl/modperl_interp.c
  
  Index: modperl_interp.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_interp.c,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- modperl_interp.c  29 Apr 2004 22:06:55 -0000      1.62
  +++ modperl_interp.c  18 Sep 2004 04:33:34 -0000      1.63
  @@ -248,7 +248,7 @@
   
       MP_TRACE_i(MP_FUNC, "server=%s\n", modperl_server_desc(s, p));
       
  -    if (scfg->threaded_mpm) {
  +    if (modperl_threaded_mpm()) {
           mip->tipool = modperl_tipool_new(p, scfg->interp_pool_cfg,
                                            &interp_pool_func, mip);
       }
  @@ -341,7 +341,7 @@
       MP_dSCFG(s);
       modperl_interp_t *interp = NULL;
   
  -    if (scfg && (is_startup || !scfg->threaded_mpm)) {
  +    if (scfg && (is_startup || !modperl_threaded_mpm())) {
           MP_TRACE_i(MP_FUNC, "using parent interpreter at %s\n",
                      is_startup ? "startup" : "request time (non-threaded MPM)");
   
  @@ -383,7 +383,7 @@
       int is_subrequest = (r && r->main) ? 1 : 0;
       modperl_interp_scope_e scope;
   
  -    if (!scfg->threaded_mpm) {
  +    if (!modperl_threaded_mpm()) {
           MP_TRACE_i(MP_FUNC,
                      "using parent 0x%lx for non-threaded mpm (%s:%d)\n",
                      (unsigned long)scfg->mip->parent,
  
  
  
  1.77      +0 -1      modperl-2.0/src/modules/perl/modperl_types.h
  
  Index: modperl_types.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_types.h,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- modperl_types.h   18 Aug 2004 22:05:16 -0000      1.76
  +++ modperl_types.h   18 Sep 2004 04:33:34 -0000      1.77
  @@ -137,7 +137,6 @@
       MpAV *handlers_process[MP_HANDLER_NUM_PROCESS];
       MpAV *handlers_pre_connection[MP_HANDLER_NUM_PRE_CONNECTION];
       MpAV *handlers_connection[MP_HANDLER_NUM_CONNECTION];
  -    int threaded_mpm;
   #ifdef USE_ITHREADS
       modperl_interp_pool_t *mip;
       modperl_tipool_config_t *interp_pool_cfg;
  
  
  

Reply via email to