You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by to...@apache.org on 2010/05/02 20:45:49 UTC

svn commit: r940297 - in /perl/modperl/branches/threading: src/modules/perl/ t/response/TestModperl/ t/response/TestPerl/ xs/maps/

Author: torsten
Date: Sun May  2 18:45:49 2010
New Revision: 940297

URL: http://svn.apache.org/viewvc?rev=940297&view=rev
Log:
now it compiles and tests with a non-threaded perl

Modified:
    perl/modperl/branches/threading/src/modules/perl/modperl_cmd.c
    perl/modperl/branches/threading/src/modules/perl/modperl_types.h
    perl/modperl/branches/threading/t/response/TestModperl/interpreter.pm
    perl/modperl/branches/threading/t/response/TestPerl/ithreads3.pm
    perl/modperl/branches/threading/xs/maps/modperl_functions.map
    perl/modperl/branches/threading/xs/maps/modperl_structures.map
    perl/modperl/branches/threading/xs/maps/modperl_types.map

Modified: perl/modperl/branches/threading/src/modules/perl/modperl_cmd.c
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/src/modules/perl/modperl_cmd.c?rev=940297&r1=940296&r2=940297&view=diff
==============================================================================
--- perl/modperl/branches/threading/src/modules/perl/modperl_cmd.c (original)
+++ perl/modperl/branches/threading/src/modules/perl/modperl_cmd.c Sun May  2 18:45:49 2010
@@ -556,8 +556,10 @@ MP_CMD_SRV_DECLARE(perldo)
                           arg, NULL);
     }
 
+#ifdef USE_ITHREADS
     MP_TRACE_i(MP_FUNC, "using interp %lx to execute perl section:\n%s",
                scfg->mip->parent, arg);
+#endif
 
     {
         SV *server = MP_PERLSECTIONS_SERVER_SV;

Modified: perl/modperl/branches/threading/src/modules/perl/modperl_types.h
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/src/modules/perl/modperl_types.h?rev=940297&r1=940296&r2=940297&view=diff
==============================================================================
--- perl/modperl/branches/threading/src/modules/perl/modperl_types.h (original)
+++ perl/modperl/branches/threading/src/modules/perl/modperl_types.h Sun May  2 18:45:49 2010
@@ -40,6 +40,8 @@ typedef struct {
     server_rec  *s;
 } modperl_rcs_t;
 
+typedef struct modperl_config_con_t modperl_config_con_t;
+
 #ifdef USE_ITHREADS
 
 typedef struct modperl_list_t modperl_list_t;
@@ -52,7 +54,7 @@ struct modperl_list_t {
 typedef struct modperl_interp_t modperl_interp_t;
 typedef struct modperl_interp_pool_t modperl_interp_pool_t;
 typedef struct modperl_tipool_t modperl_tipool_t;
-typedef struct modperl_config_con_t modperl_config_con_t;
+typedef struct modperl_tipool_config_t modperl_tipool_config_t;
 
 struct modperl_interp_t {
     modperl_interp_pool_t *mip;
@@ -80,13 +82,13 @@ typedef struct {
                         modperl_list_t *listp);
 } modperl_tipool_vtbl_t;
 
-typedef struct {
+typedef struct modperl_tipool_config_t {
     int start; /* number of items to create at startup */
     int min_spare; /* minimum number of spare items */
     int max_spare; /* maximum number of spare items */
     int max; /* maximum number of items */
     int max_requests; /* maximum number of requests per item */
-} modperl_tipool_config_t;
+};
 
 struct modperl_tipool_t {
     perl_mutex tiplock;

Modified: perl/modperl/branches/threading/t/response/TestModperl/interpreter.pm
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/t/response/TestModperl/interpreter.pm?rev=940297&r1=940296&r2=940297&view=diff
==============================================================================
--- perl/modperl/branches/threading/t/response/TestModperl/interpreter.pm (original)
+++ perl/modperl/branches/threading/t/response/TestModperl/interpreter.pm Sun May  2 18:45:49 2010
@@ -7,10 +7,6 @@ use warnings FATAL => 'all';
 use Apache::Test;
 use Apache::TestUtil;
 
-use ModPerl::Interpreter ();
-use ModPerl::InterpPool ();
-use ModPerl::TiPool ();
-use ModPerl::TiPoolConfig ();
 use Apache2::MPM ();
 
 use Apache2::Const -compile => 'OK';
@@ -20,7 +16,14 @@ sub handler {
 
     my $is_threaded=Apache2::MPM->is_threaded;
 
-    plan $r, tests => $is_threaded?17:5;
+    plan $r, tests => $is_threaded?17:5, need
+        need_threads,
+        {"perl >= 5.8.1 is required (this is $])" => ($] >= 5.008001)};
+
+    require ModPerl::Interpreter;
+    require ModPerl::InterpPool;
+    require ModPerl::TiPool;
+    require ModPerl::TiPoolConfig;
 
     my $interp = ModPerl::Interpreter->current;
 

Modified: perl/modperl/branches/threading/t/response/TestPerl/ithreads3.pm
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/t/response/TestPerl/ithreads3.pm?rev=940297&r1=940296&r2=940297&view=diff
==============================================================================
--- perl/modperl/branches/threading/t/response/TestPerl/ithreads3.pm (original)
+++ perl/modperl/branches/threading/t/response/TestPerl/ithreads3.pm Sun May  2 18:45:49 2010
@@ -10,7 +10,6 @@ use Apache2::RequestUtil ();
 use Apache2::Connection ();
 use Apache2::ConnectionUtil ();
 use APR::Pool ();
-use ModPerl::Interpreter ();
 use ModPerl::Util ();
 use APR::Table ();
 use Apache2::Const -compile => 'OK', 'DECLINED';
@@ -24,12 +23,21 @@ use Apache2::Const -compile => 'OK', 'DE
     sub DESTROY {my $f=shift @{$_[0]}; $f->(@{$_[0]});}
 }
 
+sub current_interp {
+    use Config;
+    if ($Config{useithreads} and
+        $Config{useithreads} eq 'define') {
+        require ModPerl::Interpreter;
+        ModPerl::Interpreter::current();
+    }
+}
+
 sub init {
     my $r=shift;
 
     return Apache2::Const::DECLINED unless( $r->is_initial_req );
 
-    my $interp=ModPerl::Interpreter::current;
+    my $interp=current_interp;
     $r->connection->notes->{interp}=join(':', $$interp, $interp->num_requests);
     $r->connection->notes->{refcnt}=$interp->refcnt;
 
@@ -41,7 +49,7 @@ sub add {
 
     return Apache2::Const::DECLINED unless( $r->is_initial_req );
 
-    my $interp=ModPerl::Interpreter::current;
+    my $interp=current_interp;
     $r->connection->notes->{interp}.=','.join(':', $$interp, $interp->num_requests);
     $r->connection->notes->{refcnt}.=','.$interp->refcnt;
 

Modified: perl/modperl/branches/threading/xs/maps/modperl_functions.map
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/xs/maps/modperl_functions.map?rev=940297&r1=940296&r2=940297&view=diff
==============================================================================
--- perl/modperl/branches/threading/xs/maps/modperl_functions.map (original)
+++ perl/modperl/branches/threading/xs/maps/modperl_functions.map Sun May  2 18:45:49 2010
@@ -165,5 +165,9 @@ MODULE=Apache2::MPM    PACKAGE=Apache2::
 MODULE=Apache2::Access   PACKAGE=guess
  mpxs_Apache2__RequestRec_allow_override_opts
 
+#_if_ do {use Apache2::Build; Apache2::Build::PERL_HAS_ITHREADS}
+
 MODULE=ModPerl::Interpreter
  mpxs_ModPerl__Interpreter_current | | class=Nullsv
+
+#_end_

Modified: perl/modperl/branches/threading/xs/maps/modperl_structures.map
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/xs/maps/modperl_structures.map?rev=940297&r1=940296&r2=940297&view=diff
==============================================================================
--- perl/modperl/branches/threading/xs/maps/modperl_structures.map (original)
+++ perl/modperl/branches/threading/xs/maps/modperl_structures.map Sun May  2 18:45:49 2010
@@ -3,6 +3,8 @@
 # for mapping see %ModPerl::MapUtil::disabled_map in
 # lib/ModPerl/MapUtil.pm
 
+#_if_ do {use Apache2::Build; Apache2::Build::PERL_HAS_ITHREADS}
+
 <modperl_interp_t>
 <  mip
 <  perl
@@ -38,3 +40,5 @@
 <  max
 <  max_requests
 </modperl_tipool_config_t>
+
+#_end_

Modified: perl/modperl/branches/threading/xs/maps/modperl_types.map
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/xs/maps/modperl_types.map?rev=940297&r1=940296&r2=940297&view=diff
==============================================================================
--- perl/modperl/branches/threading/xs/maps/modperl_types.map (original)
+++ perl/modperl/branches/threading/xs/maps/modperl_types.map Sun May  2 18:45:49 2010
@@ -1,12 +1,17 @@
 ##########  mod_perl types  ##########
 
 struct modperl_filter_t        | Apache2::OutputFilter
+
+#_if_ do {use Apache2::Build; Apache2::Build::PERL_HAS_ITHREADS}
+
 struct modperl_interp_t        | ModPerl::Interpreter
 struct modperl_interp_pool_t   | ModPerl::InterpPool
 struct modperl_tipool_t        | ModPerl::TiPool
 struct modperl_tipool_config_t | ModPerl::TiPoolConfig
 PerlInterpreter *              | IV
 
+#_end_
+
 ##########  Perl types  ##########
 
 SV *  | SV