You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ch...@apache.org on 2007/01/02 21:13:57 UTC
svn commit: r491922 - in /httpd/httpd/trunk: CHANGES server/mpm/beos/beos.c
Author: chrisd
Date: Tue Jan 2 12:13:57 2007
New Revision: 491922
URL: http://svn.apache.org/viewvc?view=rev&rev=491922
Log:
Create pmain pool and run modules' child_init hooks when entering
ap_mpm_run(), then destroy pmain when exiting ap_mpm_run().
The expected call to ap_run_child_init() appears to have been removed
in r89640. However, that call should presumably still be made once per
process, as in other single-process MPMs like the netware MPM.
Modified:
httpd/httpd/trunk/CHANGES
httpd/httpd/trunk/server/mpm/beos/beos.c
Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?view=diff&rev=491922&r1=491921&r2=491922
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Jan 2 12:13:57 2007
@@ -2,6 +2,10 @@
Changes with Apache 2.3.0
[Remove entries to the current 2.0 and 2.2 section below, when backported]
+ *) beos MPM: Create pmain pool and run modules' child_init hooks when
+ entering ap_mpm_run(), then destroy pmain when exiting ap_mpm_run().
+ [Chris Darroch]
+
*) netware MPM: Destroy pmain pool when exiting ap_mpm_run() so that
cleanups registered in modules' child_init hooks are performed.
[Chris Darroch]
Modified: httpd/httpd/trunk/server/mpm/beos/beos.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/beos/beos.c?view=diff&rev=491922&r1=491921&r2=491922
==============================================================================
--- httpd/httpd/trunk/server/mpm/beos/beos.c (original)
+++ httpd/httpd/trunk/server/mpm/beos/beos.c Tue Jan 2 12:13:57 2007
@@ -102,6 +102,7 @@
apr_thread_mutex_t *accept_mutex = NULL;
static apr_pool_t *pconf; /* Pool for config stuff */
+static apr_pool_t *pmain; /* Pool for httpd child stuff */
static int server_pid;
@@ -146,6 +147,14 @@
exit_thread(code);
}
+/* proper cleanup when returning from ap_mpm_run() */
+static void mpm_main_cleanup(void)
+{
+ if (pmain) {
+ apr_pool_destroy(pmain);
+ }
+}
+
/*****************************************************************
* Connection structures and accounting...
@@ -898,6 +907,9 @@
set_signals();
+ apr_pool_create(&pmain, pconf);
+ ap_run_child_init(pmain, ap_server_conf);
+
/* Sanity checks to avoid thrashing... */
if (max_spare_threads < min_spare_threads )
max_spare_threads = min_spare_threads;
@@ -972,6 +984,7 @@
}
if (one_process) {
+ mpm_main_cleanup();
return 1;
}
@@ -995,6 +1008,7 @@
"caught SIGTERM, shutting down");
}
+ mpm_main_cleanup();
return 1;
}
@@ -1020,6 +1034,7 @@
*/
apr_thread_mutex_destroy(accept_mutex);
+ mpm_main_cleanup();
return 0;
}