]> granicus.if.org Git - apache/commitdiff
simplify the MaxRequestPerChild logic in worker_thread's hot path
authorGreg Ames <gregames@apache.org>
Wed, 2 May 2001 17:46:34 +0000 (17:46 +0000)
committerGreg Ames <gregames@apache.org>
Wed, 2 May 2001 17:46:34 +0000 (17:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88976 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/threaded/threaded.c

index 463780efcf9ae333135ff13a353fe38b4d34754a..05e29a781b83f268f5181a46602b1fb2aeec340b 100644 (file)
@@ -93,6 +93,7 @@
 #include "scoreboard.h" 
 
 #include <signal.h>
+#include <limits.h>             /* 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;
 }