]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mpm_event: minor code simplification
authorStefan Fritsch <sf@apache.org>
Sat, 20 Aug 2016 20:45:40 +0000 (20:45 +0000)
committerStefan Fritsch <sf@apache.org>
Sat, 20 Aug 2016 20:45:40 +0000 (20:45 +0000)
- 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

server/mpm/event/event.c

index c53eed40d72fcc7145f73fe7af6c2b638f3b3a20..96a02a6738e3bdd347e464e87e4fac38964b762d 100644 (file)
@@ -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)