From 7a38f2b3418bee5e6bcf06063ed3049a966c550a Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Wed, 2 May 2001 17:46:34 +0000 Subject: [PATCH] simplify the MaxRequestPerChild logic in worker_thread's hot path git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88976 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/threaded/threaded.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/mpm/threaded/threaded.c b/server/mpm/threaded/threaded.c index 463780efcf..05e29a781b 100644 --- a/server/mpm/threaded/threaded.c +++ b/server/mpm/threaded/threaded.c @@ -93,6 +93,7 @@ #include "scoreboard.h" #include +#include /* for INT_MAX */ /* * Actual definitions of config globals @@ -488,7 +489,7 @@ static void * worker_thread(void * dummy) /* TODO: Switch to a system where threads reuse the results from earlier poll calls - manoj */ while (1) { - workers_may_exit |= (ap_max_requests_per_child != 0) && (requests_this_child <= 0); + workers_may_exit |= (requests_this_child <= 0); if (workers_may_exit) break; (void) ap_update_child_status(process_slot, thread_slot, SERVER_READY, @@ -1378,6 +1379,14 @@ static const char *set_max_requests(cmd_parms *cmd, void *dummy, } ap_max_requests_per_child = atoi(arg); + + /* a value of zero means infinity. The following removes a conditional + * from worker_thread's hot path + */ + + if (!ap_max_requests_per_child) { + ap_max_requests_per_child = INT_MAX; + } return NULL; } -- 2.50.1