dougm       02/05/23 10:30:26

  Modified:    src/modules/perl mod_perl.c
               t/response/TestAPR os.pm
  Log:
  add Apache::MPM_IS_THREADED constant
  
  Revision  Changes    Path
  1.117     +4 -0      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.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- mod_perl.c        22 May 2002 19:53:06 -0000      1.116
  +++ mod_perl.c        23 May 2002 17:30:26 -0000      1.117
  @@ -96,6 +96,7 @@
   static void modperl_boot(void *data)
   {
       MP_dBOOT_DATA;
  +    MP_dSCFG(s);
       dTHX; /* XXX: not too worried since this only happens at startup */
       int i;
       
  @@ -115,6 +116,9 @@
           char *name = Perl_form(aTHX_ MP_xs_loader_name, MP_xs_loaders[i]);
           newCONSTSUB(PL_defstash, name, newSViv(1));
       }
  +
  +    newCONSTSUB(PL_defstash, "Apache::MPM_IS_THREADED",
  +                newSViv(scfg->threaded_mpm));
   }
   
   static void modperl_xs_init(pTHX)
  
  
  
  1.2       +7 -3      modperl-2.0/t/response/TestAPR/os.pm
  
  Index: os.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/os.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- os.pm     22 May 2002 16:31:05 -0000      1.1
  +++ os.pm     23 May 2002 17:30:26 -0000      1.2
  @@ -15,9 +15,13 @@
   
       plan $r, tests => 1;
   
  -    my $id = APR::OS::thread_current() || $$;
  -
  -    ok t_cmp($id, $id, "current thread id or process id");
  +    if (Apache::MPM_IS_THREADED) {
  +        my $id = APR::OS::thread_current();
  +        ok t_cmp($id, $id, "current thread id");
  +    }
  +    else {
  +        ok t_cmp($$, $$, "current process id");
  +    }
   
       Apache::OK;
   }
  
  
  


Reply via email to