perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From steve...@apache.org
Subject svn commit: r1602085 - in /perl/modperl/trunk: ./ t/response/TestModperl/ xs/ModPerl/Interpreter/ xs/maps/ xs/tables/current/Apache2/ xs/tables/current/ModPerl/
Date Thu, 12 Jun 2014 07:46:32 GMT
Author: stevehay
Date: Thu Jun 12 07:46:31 2014
New Revision: 1602085

URL: http://svn.apache.org/r1602085
Log:
Merged revision(s) 1537493 from perl/modperl/branches/httpd24threading:
Merged revision(s) 594347 from perl/modperl/branches/threading:
Expose modperl_interp_pool_t via ModPerl::InterpPool, modperl_tipool_t
via ModPerl::TiPool and modperl_tipool_config_t via ModPerl::TiPoolConfig

Reviewed-By: Gozer
Submitted-By: Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200710242028.07750.torsten.foertsch@gmx.net>


........

........

Modified:
    perl/modperl/trunk/   (props changed)
    perl/modperl/trunk/Changes
    perl/modperl/trunk/t/response/TestModperl/interpreter.pm
    perl/modperl/trunk/xs/ModPerl/Interpreter/ModPerl__Interpreter.h
    perl/modperl/trunk/xs/maps/modperl_functions.map
    perl/modperl/trunk/xs/maps/modperl_structures.map
    perl/modperl/trunk/xs/maps/modperl_types.map
    perl/modperl/trunk/xs/tables/current/Apache2/StructureTable.pm
    perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm

Propchange: perl/modperl/trunk/
------------------------------------------------------------------------------
  Merged /perl/modperl/branches/threading:r594347
  Merged /perl/modperl/branches/httpd24threading:r1537493

Modified: perl/modperl/trunk/Changes
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/Changes?rev=1602085&r1=1602084&r2=1602085&view=diff
==============================================================================
--- perl/modperl/trunk/Changes (original)
+++ perl/modperl/trunk/Changes Thu Jun 12 07:46:31 2014
@@ -12,6 +12,10 @@ Also refer to the Apache::Test changes l
 
 =item 2.0.9-dev
 
+Expose modperl_interp_pool_t via ModPerl::InterpPool, modperl_tipool_t
+via ModPerl::TiPool and modperl_tipool_config_t via ModPerl::TiPoolConfig
+[Torsten Foertsch]
+
 Expose modperl_interp_t via ModPerl::Interpreter [Torsten Foertsch]
 
 Fix t/compat/apache_file.t on Windows. Apache::File->tmpfile() wants TMPDIR

Modified: perl/modperl/trunk/t/response/TestModperl/interpreter.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestModperl/interpreter.pm?rev=1602085&r1=1602084&r2=1602085&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestModperl/interpreter.pm (original)
+++ perl/modperl/trunk/t/response/TestModperl/interpreter.pm Thu Jun 12 07:46:31 2014
@@ -1,7 +1,5 @@
 package TestModperl::interpreter;
 
-# Modperl::Util tests
-
 use strict;
 use warnings FATAL => 'all';
 
@@ -9,22 +7,68 @@ 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';
 
 sub handler {
     my $r = shift;
 
-    plan $r, tests => 5;
-    
-    my $interp = ModPerl::Interpreter::current();
-    print STDERR Dumper($interp); use Data::Dumper;
-    ok t_cmp ref($interp), 'ModPerl::Interpreter';
-    
-    ok $interp->num_requests > 0;
-    ok $interp->refcnt > 0;
-    ok $interp->mip > 0; 
-    ok $interp->perl > 0; 
+    my $is_threaded=Apache2::MPM->is_threaded;
+
+    plan $r, tests => $is_threaded?17:5;
+
+    my $interp = ModPerl::Interpreter->current;
+
+    ok t_cmp(ref($interp), 'ModPerl::Interpreter',
+	     'interp is a ModPerl::Interpreter');
+
+    ok t_cmp($$interp==${ModPerl::Interpreter::current()}, !!1,
+	     'ModPerl::Interpreter->current == ModPerl::Interpreter::current');
+
+    my $mip = $interp->mip;
+
+    ok t_cmp(ref($mip), 'ModPerl::InterpPool',
+	     'interp->mip is a ModPerl::InterpPool');
+
+    ok t_cmp(${$mip->server}==${$r->server}, !!1,
+	     'mip->server == r->server');
+
+    ok t_cmp(ref($mip->parent), 'ModPerl::Interpreter',
+	     'mip->parent is a ModPerl::Interpreter');
+
+    if($is_threaded) {
+	ok t_cmp($interp->perl!=0, !!1, 'interp->perl');
+	ok t_cmp($interp->num_requests>0, !!1, 'interp->num_requests');
+	ok t_cmp($interp->refcnt>0, !!1, 'interp->refcnt');
+
+	my $tipool = $mip->tipool;
+
+	ok t_cmp(ref($tipool), 'ModPerl::TiPool',
+		 'mip->tipool is a ModPerl::TiPool');
+
+	ok t_cmp($tipool->in_use!=0, !!1, 'tipool->in_use');
+
+	ok t_cmp($tipool->size!=0, !!1, 'tipool->size');
+
+	my $tipcfg = $tipool->cfg;
+
+	ok t_cmp(ref($tipcfg), 'ModPerl::TiPoolConfig',
+		 'tipool->cfg is a ModPerl::TiPoolConfig');
+
+	ok t_cmp($tipcfg->start!=0, !!1, 'tipcfg->start');
+
+	ok t_cmp($tipcfg->min_spare!=0, !!1, 'tipcfg->min_spare');
+
+	ok t_cmp($tipcfg->max_spare!=0, !!1, 'tipcfg->max_spare');
+
+	ok t_cmp($tipcfg->max!=0, !!1, 'tipcfg->max');
+
+	ok t_cmp($tipcfg->max_requests!=0, !!1, 'tipcfg->max_requests');
+    }
 
     Apache2::Const::OK;
 }

Modified: perl/modperl/trunk/xs/ModPerl/Interpreter/ModPerl__Interpreter.h
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/ModPerl/Interpreter/ModPerl__Interpreter.h?rev=1602085&r1=1602084&r2=1602085&view=diff
==============================================================================
--- perl/modperl/trunk/xs/ModPerl/Interpreter/ModPerl__Interpreter.h (original)
+++ perl/modperl/trunk/xs/ModPerl/Interpreter/ModPerl__Interpreter.h Thu Jun 12 07:46:31 2014
@@ -15,7 +15,7 @@
  */
 
 static MP_INLINE
-modperl_interp_t *mpxs_ModPerl__Interpreter_current(pTHX)
+modperl_interp_t *mpxs_ModPerl__Interpreter_current(pTHX_ SV *class)
 {
     return MP_THX_INTERP_GET(aTHX);
 }

Modified: perl/modperl/trunk/xs/maps/modperl_functions.map
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/maps/modperl_functions.map?rev=1602085&r1=1602084&r2=1602085&view=diff
==============================================================================
--- perl/modperl/trunk/xs/maps/modperl_functions.map (original)
+++ perl/modperl/trunk/xs/maps/modperl_functions.map Thu Jun 12 07:46:31 2014
@@ -164,4 +164,4 @@ MODULE=Apache2::Access   PACKAGE=guess
  mpxs_Apache2__RequestRec_allow_override_opts
 
 MODULE=ModPerl::Interpreter
- mpxs_ModPerl__Interpreter_current
+ mpxs_ModPerl__Interpreter_current | | class=Nullsv

Modified: perl/modperl/trunk/xs/maps/modperl_structures.map
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/maps/modperl_structures.map?rev=1602085&r1=1602084&r2=1602085&view=diff
==============================================================================
--- perl/modperl/trunk/xs/maps/modperl_structures.map (original)
+++ perl/modperl/trunk/xs/maps/modperl_structures.map Thu Jun 12 07:46:31 2014
@@ -12,3 +12,29 @@
 <  refcnt
 -  tid
 </modperl_interp_t>
+
+<modperl_interp_pool_t>
+<  server
+<  tipool
+<  parent
+</modperl_interp_pool_t>
+
+<modperl_tipool_t>
+-  tiplock
+-  available
+-  idle
+-  busy
+<  in_use
+<  size
+-  data
+<  cfg
+-  func
+</modperl_tipool_t>
+
+<modperl_tipool_config_t>
+<  start
+<  min_spare
+<  max_spare
+<  max
+<  max_requests
+</modperl_tipool_config_t>

Modified: perl/modperl/trunk/xs/maps/modperl_types.map
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/maps/modperl_types.map?rev=1602085&r1=1602084&r2=1602085&view=diff
==============================================================================
--- perl/modperl/trunk/xs/maps/modperl_types.map (original)
+++ perl/modperl/trunk/xs/maps/modperl_types.map Thu Jun 12 07:46:31 2014
@@ -1,9 +1,11 @@
 ##########  mod_perl types  ##########
 
-struct modperl_filter_t | Apache2::OutputFilter
-struct modperl_interp_t | ModPerl::Interpreter
-modperl_interp_pool_t * | IV
-PerlInterpreter *       | IV
+struct modperl_filter_t        | Apache2::OutputFilter
+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
 
 ##########  Perl types  ##########
 

Modified: perl/modperl/trunk/xs/tables/current/Apache2/StructureTable.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/tables/current/Apache2/StructureTable.pm?rev=1602085&r1=1602084&r2=1602085&view=diff
==============================================================================
--- perl/modperl/trunk/xs/tables/current/Apache2/StructureTable.pm (original)
+++ perl/modperl/trunk/xs/tables/current/Apache2/StructureTable.pm Thu Jun 12 07:46:31 2014
@@ -3366,6 +3366,93 @@ $Apache2::StructureTable = [
         'name' => 'tid'
       }
     ]
+  },
+  {
+    'type' => 'modperl_interp_pool_t',
+    'elts' => [
+      {
+        'type' => 'server_rec *',
+        'name' => 'server'
+      },
+      {
+        'type' => 'modperl_tipool_t *',
+        'name' => 'tipool'
+      },
+      {
+        'type' => 'modperl_tipool_config_t *',
+        'name' => 'tipool_cfg'
+      },
+      {
+        'type' => 'modperl_interp_t *',
+        'name' => 'parent'
+      }
+    ]
+  },
+  {
+    'type' => 'modperl_tipool_t',
+    'elts' => [
+      {
+        'type' => 'perl_mutex',
+        'name' => 'tiplock'
+      },
+      {
+        'type' => 'perl_cond',
+        'name' => 'available'
+      },
+      {
+        'type' => 'modperl_list_t *',
+        'name' => 'idle'
+      },
+      {
+        'type' => 'modperl_list_t *',
+        'name' => 'busy'
+      },
+      {
+        'type' => 'int',
+        'name' => 'in_use'
+      },
+      {
+        'type' => 'int',
+        'name' => 'size'
+      },
+      {
+        'type' => 'void *',
+        'name' => 'data'
+      },
+      {
+        'type' => 'modperl_tipool_config_t *',
+        'name' => 'cfg'
+      },
+      {
+        'type' => 'modperl_tipool_vtbl_t *',
+        'name' => 'func'
+      }
+    ]
+  },
+  {
+    'type' => 'modperl_tipool_config_t',
+    'elts' => [
+      {
+        'type' => 'int',
+        'name' => 'start'
+      },
+      {
+        'type' => 'int',
+        'name' => 'min_spare'
+      },
+      {
+        'type' => 'int',
+        'name' => 'max_spare'
+      },
+      {
+        'type' => 'int',
+        'name' => 'max'
+      },
+      {
+        'type' => 'int',
+        'name' => 'max_requests'
+      }
+    ]
   }
 ];
 

Modified: perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm?rev=1602085&r1=1602084&r2=1602085&view=diff
==============================================================================
--- perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm (original)
+++ perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm Thu Jun 12 07:46:31 2014
@@ -8267,6 +8267,10 @@ $ModPerl::FunctionTable = [
       {
         'type' => 'PerlInterpreter *',
         'name' => 'my_perl'
+      },
+      {
+        'type' => 'SV *',
+        'name' => 'class'
       }
     ]
   }



Mime
View raw message