perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r109900 - /perl/modperl/trunk/Changes /perl/modperl/trunk/src/modules/perl/mod_perl.c /perl/modperl/trunk/src/modules/perl/mod_perl.h /perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h
Date Sun, 05 Dec 2004 18:55:25 GMT
Author: stas
Date: Sun Dec  5 10:55:24 2004
New Revision: 109900

URL: http://svn.apache.org/viewcvs?view=rev&rev=109900
Log:
create a new subpool modperl_server_user_pool (from
modperl_server_pool), which is handed to users via
Apache::ServerUtil::base_server_pool(). This ensures that
user-registered cleanups are run *before* perl's internals cleanups
are run. (previously there was a problem with non-threaded perls which
were segfaulting on user cleanups, since perl was already gone by that
time).

Modified:
   perl/modperl/trunk/Changes
   perl/modperl/trunk/src/modules/perl/mod_perl.c
   perl/modperl/trunk/src/modules/perl/mod_perl.h
   perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h

Modified: perl/modperl/trunk/Changes
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/Changes?view=diff&rev=109900&p1=perl/modperl/trunk/Changes&r1=109899&p2=perl/modperl/trunk/Changes&r2=109900
==============================================================================
--- perl/modperl/trunk/Changes	(original)
+++ perl/modperl/trunk/Changes	Sun Dec  5 10:55:24 2004
@@ -12,6 +12,14 @@
 
 =item 1.99_18-dev
 
+create a new subpool modperl_server_user_pool (from
+modperl_server_pool), which is handed to users via
+Apache::ServerUtil::base_server_pool(). This ensures that
+user-registered cleanups are run *before* perl's internals cleanups
+are run. (previously there was a problem with non-threaded perls which
+were segfaulting on user cleanups, since perl was already gone by that
+time). [Stas]
+
 Starting from ExtUtils::MakeMaker 6.22 it no longer generates
 pm_to_blib target, but pm_to_blib.ts, so needed to fix the glue_pod
 target, so install will work correctly [Stas]

Modified: perl/modperl/trunk/src/modules/perl/mod_perl.c
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/mod_perl.c?view=diff&rev=109900&p1=perl/modperl/trunk/src/modules/perl/mod_perl.c&r1=109899&p2=perl/modperl/trunk/src/modules/perl/mod_perl.c&r2=109900
==============================================================================
--- perl/modperl/trunk/src/modules/perl/mod_perl.c	(original)
+++ perl/modperl/trunk/src/modules/perl/mod_perl.c	Sun Dec  5 10:55:24 2004
@@ -130,14 +130,26 @@
  * the parent process will run the cleanups since server_pool is a subpool
  * of pconf.  we manually clear the server_pool to run cleanups in the
  * child processes
+ *
+ * the "server_user_pool" is a subpool of the "server_pool", this is
+ * the pool which is exposed to users, so that they can register
+ * cleanup callbacks. This is needed so that the perl cleanups won't
+ * be run before user cleanups are executed.
+ *
  */
 static apr_pool_t *server_pool = NULL;
+static apr_pool_t *server_user_pool = NULL;
 
 apr_pool_t *modperl_server_pool(void)
 {
     return server_pool;
 }
 
+apr_pool_t *modperl_server_user_pool(void)
+{
+    return server_user_pool;
+}
+
 static void set_taint_var(PerlInterpreter *perl)
 {
     dTHXa(perl);
@@ -553,6 +565,9 @@
 
     apr_pool_create(&server_pool, pconf);
     apr_pool_tag(server_pool, "mod_perl server pool");
+
+    apr_pool_create(&server_user_pool, pconf);
+    apr_pool_tag(server_user_pool, "mod_perl server user pool");
 
     modperl_sys_init();
     apr_pool_cleanup_register(server_pool, NULL,

Modified: perl/modperl/trunk/src/modules/perl/mod_perl.h
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/mod_perl.h?view=diff&rev=109900&p1=perl/modperl/trunk/src/modules/perl/mod_perl.h&r1=109899&p2=perl/modperl/trunk/src/modules/perl/mod_perl.h&r2=109900
==============================================================================
--- perl/modperl/trunk/src/modules/perl/mod_perl.h	(original)
+++ perl/modperl/trunk/src/modules/perl/mod_perl.h	Sun Dec  5 10:55:24 2004
@@ -120,6 +120,7 @@
                             apr_pool_t *ptemp);
 void modperl_register_hooks(apr_pool_t *p);
 apr_pool_t *modperl_server_pool(void);
+apr_pool_t *modperl_server_user_pool(void);
 PerlInterpreter *modperl_startup(server_rec *s, apr_pool_t *p);
 int modperl_perl_destruct_level(void);
 void xs_init(pTHX);

Modified: perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h?view=diff&rev=109900&p1=perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h&r1=109899&p2=perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h&r2=109900
==============================================================================
--- perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h	(original)
+++ perl/modperl/trunk/xs/Apache/ServerUtil/Apache__ServerUtil.h	Sun Dec  5 10:55:24 2004
@@ -15,7 +15,7 @@
 
 #define mpxs_Apache__ServerUtil_restart_count modperl_restart_count
 
-#define mpxs_Apache__ServerUtil_base_server_pool modperl_server_pool
+#define mpxs_Apache__ServerUtil_base_server_pool modperl_server_user_pool
 
 #define mpxs_Apache__ServerRec_method_register(s, methname)     \
     ap_method_register(s->process->pconf, methname);

Mime
View raw message