summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2014-11-17 17:31:06 +0100
committerYann Ylavic <ylavic@apache.org>2014-11-17 17:31:06 +0100
commitfe1189c22fa6bb2a575bbb200a4af9e9c04d7bc5 (patch)
tree6b0ac7de6fa433e04bd8c41101f42cc9114a13db /server
parentmpm_event(opt), mpm_worker: follow up to r1635521. (diff)
downloadapache2-fe1189c22fa6bb2a575bbb200a4af9e9c04d7bc5.tar.xz
apache2-fe1189c22fa6bb2a575bbb200a4af9e9c04d7bc5.zip
mpm_prefork: follow up to r1635521.
Avoid oddity on bucket_make_child_record overflow. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640184 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/mpm/prefork/prefork.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c
index ab78c49bd2..c8c8266583 100644
--- a/server/mpm/prefork/prefork.c
+++ b/server/mpm/prefork/prefork.c
@@ -858,10 +858,10 @@ static void startup_children(int number_to_start)
}
}
-static int bucket_make_child_record = -1;
-static int bucket_kill_child_record = -1;
static void perform_idle_server_maintenance(apr_pool_t *p)
{
+ static int bucket_make_child_record = -1;
+ static int bucket_kill_child_record = -1;
int i;
int idle_count;
worker_score *ws;
@@ -939,8 +939,9 @@ static void perform_idle_server_maintenance(apr_pool_t *p)
}
for (i = 0; i < free_length; ++i) {
bucket_make_child_record++;
+ bucket_make_child_record %= num_buckets;
make_child(ap_server_conf, free_slots[i],
- bucket_make_child_record % num_buckets);
+ bucket_make_child_record);
}
/* the next time around we want to spawn twice as many if this
* wasn't good enough, but not if we've just done a graceful