diff options
author | Brian Havard <bjh@apache.org> | 2001-12-30 14:27:48 +0100 |
---|---|---|
committer | Brian Havard <bjh@apache.org> | 2001-12-30 14:27:48 +0100 |
commit | a329ff6cf90b78f02a283164b6b45965e03d5623 (patch) | |
tree | 955f0e19865bb957b8f8e8fed158a8dadba2dccc /server/scoreboard.c | |
parent | allow mod_include to handle different start/end tags instead of the default (diff) | |
download | apache2-a329ff6cf90b78f02a283164b6b45965e03d5623.tar.xz apache2-a329ff6cf90b78f02a283164b6b45965e03d5623.zip |
Make calc_scoreboard_size() and init_scoreboard() usable from MPMs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92661 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/scoreboard.c')
-rw-r--r-- | server/scoreboard.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/scoreboard.c b/server/scoreboard.c index 73b8880949..ce443d5da3 100644 --- a/server/scoreboard.c +++ b/server/scoreboard.c @@ -123,7 +123,7 @@ static apr_status_t ap_cleanup_shared_mem(void *d) return APR_SUCCESS; } -static void calc_scoreboard_size(void) +int ap_calc_scoreboard_size(void) { ap_mpm_query(AP_MPMQ_HARD_LIMIT_THREADS, &thread_limit); ap_mpm_query(AP_MPMQ_HARD_LIMIT_DAEMONS, &server_limit); @@ -131,9 +131,10 @@ static void calc_scoreboard_size(void) scoreboard_size += sizeof(process_score) * server_limit; scoreboard_size += sizeof(worker_score * ) * server_limit; scoreboard_size += sizeof(worker_score) * server_limit * thread_limit; + return scoreboard_size; } -static void init_scoreboard(void) +void ap_init_scoreboard(void) { char *more_storage; int i; @@ -216,7 +217,7 @@ AP_DECLARE_NONSTD(void) ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_t if (ap_scoreboard_image) running_gen = ap_scoreboard_image->global.running_generation; if (ap_scoreboard_image == NULL) { - calc_scoreboard_size(); + ap_calc_scoreboard_size(); if (sb_type == SB_SHARED) { rv = setup_shared(p); if (rv) { @@ -234,7 +235,7 @@ AP_DECLARE_NONSTD(void) ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_t } } } - init_scoreboard(); /* can't just memset() */ + ap_init_scoreboard(); /* can't just memset() */ ap_scoreboard_image->global.sb_type = sb_type; ap_scoreboard_image->global.running_generation = running_gen; ap_restart_time = apr_time_now(); |