modules to have access to the scoreboard at the time that it is
created, and at every restart request.
Submitted by: Cody Sherr <csherr@covalent.net>
Reviewed by: Ryan Bloom
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89608
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.0.21-dev
+ *) Make scoreboard creation a hook. This allows management
+ modules to have access to the scoreboard at the time that it is
+ created, and at every restart request.
+ [Cody Sherr <csherr@covalent.net>]
+
*) Changed AP_MPMQ_MAX_DAEMONS to refer to MaxClients and
added an AP_MPMQ_MAX_DAEMON_USED to refer to the highest
daemon index actually used in the scoreboard. I also
#include <time.h>
#endif
+#include "ap_config.h"
#include "mpm_default.h" /* For HARD_.*_LIMIT */
+#include "apr_hooks.h"
#include "apr_thread_proc.h"
#include "apr_portable.h"
AP_DECLARE_DATA extern ap_generation_t volatile ap_my_generation;
+/* Hooks */
+/**
+ * Hook for post scoreboard creation, pre mpm.
+ * @param p Apache pool to allocate from.
+ * @param sb_type
+ * @ingroup hooks
+ */
+AP_DECLARE_HOOK(void, pre_mpm, (apr_pool_t *p, ap_scoreboard_e sb_type))
+
/* for time_process_request() in http_main.c */
#define START_PREQUEST 1
#define STOP_PREQUEST 2
ap_hook_type_checker(do_nothing,NULL,NULL,APR_HOOK_REALLY_LAST);
ap_hook_access_checker(do_nothing,NULL,NULL,APR_HOOK_REALLY_LAST);
ap_hook_create_request(core_create_req, NULL, NULL, APR_HOOK_MIDDLE);
+ ap_hook_pre_mpm(ap_create_scoreboard, NULL, NULL, APR_HOOK_MIDDLE);
/* register the core's insert_filter hook and register core-provided
* filters
*/
if (!is_graceful)
- ap_create_scoreboard(pconf, SB_SHARED);
+ ap_run_pre_mpm(pconf, SB_SHARED);
if (!is_graceful) {
for (i = 0; i < HARD_SERVER_LIMIT; i++) {
}
if (!is_graceful) {
- ap_create_scoreboard(pconf, SB_SHARED);
+ ap_run_pre_mpm(pconf, SB_SHARED);
}
/* Initialize the child table */
if (!is_graceful) {
}
if (!is_graceful) {
- ap_create_scoreboard(pconf, SB_SHARED);
+ ap_run_pre_mpm(pconf, SB_SHARED);
}
/* Initialize the child table */
if (!is_graceful) {
SAFE_ACCEPT(accept_mutex_init(pconf));
if (!is_graceful) {
- ap_create_scoreboard(pconf, SB_SHARED);
+ ap_run_pre_mpm(pconf, SB_SHARED);
}
#ifdef SCOREBOARD_FILE
else {
SAFE_ACCEPT(accept_mutex_init(pconf));
if (!is_graceful) {
- ap_create_scoreboard(pconf, SB_NOT_SHARED);
+ ap_run_pre_mpm(pconf, SB_NOT_SHARED);
memset(thread_control, 0, sizeof(thread_control));
}
}
if (!is_graceful) {
- ap_create_scoreboard(pconf, SB_SHARED);
+ ap_run_pre_mpm(pconf, SB_SHARED);
}
set_signals();
"Child %d: Child process is running", my_pid);
/* Set up the scoreboard. */
- ap_create_scoreboard(pconf, SB_NOT_SHARED);
+ ap_run_pre_mpm(pconf, SB_NOT_SHARED);
if (one_process) {
if (ap_setup_listeners(server_conf) < 1) {
return 1;
#include "apr_shmem.h"
static apr_shmem_t *scoreboard_shm = NULL;
#endif
+
+APR_HOOK_STRUCT(
+ APR_HOOK_LINK(pre_mpm)
+)
+
+AP_IMPLEMENT_HOOK_VOID(pre_mpm,
+ (apr_pool_t *p, ap_scoreboard_e sb_type),
+ (p, sb_type))
+
/*
* ToDo:
* This function should be renamed to cleanup_shared