From: Stefan Fritsch Date: Sat, 20 Aug 2016 20:45:40 +0000 (+0000) Subject: mpm_event: minor code simplification X-Git-Tag: 2.5.0-alpha~1227 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3293266ce37784a3d60cfb199ccf6725ee07d39;p=thirdparty%2Fapache%2Fhttpd.git mpm_event: minor code simplification - move variable initializations into declarations - use max_workers variable git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1757030 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index c53eed40d72..96a02a6738e 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -2813,23 +2813,16 @@ static void startup_children(int number_to_start) static void perform_idle_server_maintenance(int child_bucket, int num_buckets) { int i, j; - int idle_thread_count; + int idle_thread_count = 0; worker_score *ws; process_score *ps; - int free_length; + int free_length = 0; int totally_free_length = 0; int free_slots[MAX_SPAWN_RATE]; - int last_non_dead; - int total_non_dead; + int last_non_dead = -1; + int total_non_dead = 0; int active_thread_count = 0; - /* initialize the free_list */ - free_length = 0; - - idle_thread_count = 0; - last_non_dead = -1; - total_non_dead = 0; - for (i = 0; i < ap_daemons_limit; ++i) { /* Initialization to satisfy the compiler. It doesn't know * that threads_per_child is always > 0 */ @@ -2947,7 +2940,7 @@ static void perform_idle_server_maintenance(int child_bucket, int num_buckets) /* terminate the free list */ if (free_length == 0) { /* scoreboard is full, can't fork */ - if (active_thread_count >= ap_daemons_limit * threads_per_child) { + if (active_thread_count >= max_workers) { if (!retained->maxclients_reported) { /* only report this condition once */ ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf, APLOGNO(00484)