summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStefan Eissing <icing@apache.org>2022-02-24 11:53:53 +0000
committerStefan Eissing <icing@apache.org>2022-02-24 11:53:53 +0000
commit2e239ed8e65a0a7cc5f12d64b4d21cc92ab08709 (patch)
treeedbc212c0d79ec080b86549310bd4cca55ef4a5b /include
parent80a4538022762794dc9e04dd5886a9bfce61418d (diff)
downloadhttpd-2e239ed8e65a0a7cc5f12d64b4d21cc92ab08709.tar.gz
* core/mpm: add hook 'child_stopped` that gets called when the MPM has
stopped all processing in a child process. This is when all running threads shall be stopped and joined. [Stefan Eissing] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898369 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r--include/ap_mmn.h4
-rw-r--r--include/mpm_common.h20
2 files changed, 21 insertions, 3 deletions
diff --git a/include/ap_mmn.h b/include/ap_mmn.h
index 4fda68b1b3..84c566e0f0 100644
--- a/include/ap_mmn.h
+++ b/include/ap_mmn.h
@@ -700,6 +700,8 @@
* add PROXY_WORKER_UDS_PATH_SIZE.
* 20211221.3 (2.5.1-dev) Add ap_thread_create(), ap_thread_main_create()
* and ap_thread_current()
+ * 20211221.4 (2.5.1-dev) Add hook child_stopped to get informed that a child
+ * has stopped processing any requests.
*
*/
@@ -708,7 +710,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20211221
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 3 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 4 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
diff --git a/include/mpm_common.h b/include/mpm_common.h
index 007a24a498..334624ee06 100644
--- a/include/mpm_common.h
+++ b/include/mpm_common.h
@@ -512,14 +512,30 @@ AP_DECLARE_HOOK(void, resume_connection,
(conn_rec *c, request_rec *r))
/**
- * Notification that the child is stopping. If graceful, ongoing
- * requests will be served.
+ * Notification that the child is stopping. No new requests
+ * or other tasks to be started.
+ * If graceful, already started requests/tasks should be
+ * processed normally.
* @param pchild The child pool
* @param graceful != 0 iff this is a graceful shutdown.
*/
AP_DECLARE_HOOK(void, child_stopping,
(apr_pool_t *pchild, int graceful))
+/**
+ * Notification that the child has stopped processing
+ * requests completely. Any running threads should be
+ * shut down now.
+ * Ideally, when this hook completes, no more threads
+ * are running in the child process.
+ * Note that de-allocation of global resources should
+ * be run via memory pool destroy callback after this.
+ * @param pchild The child pool
+ * @param graceful != 0 iff this is a graceful shutdown.
+ */
+AP_DECLARE_HOOK(void, child_stopped,
+ (apr_pool_t *pchild, int graceful))
+
/* mutex type string for accept mutex, if any; MPMs should use the
* same mutex type for ease of configuration
*/