Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A11D3200B69 for ; Sat, 20 Aug 2016 22:45:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 94D4C160ABE; Sat, 20 Aug 2016 20:45:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E6263160A76 for ; Sat, 20 Aug 2016 22:45:44 +0200 (CEST) Received: (qmail 4865 invoked by uid 500); 20 Aug 2016 20:45:44 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 4856 invoked by uid 99); 20 Aug 2016 20:45:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Aug 2016 20:45:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id B5DC01800B7 for ; Sat, 20 Aug 2016 20:45:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.426 X-Spam-Level: X-Spam-Status: No, score=-0.426 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 0modvcDAktKq for ; Sat, 20 Aug 2016 20:45:42 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTP id 5448A5FBD3 for ; Sat, 20 Aug 2016 20:45:42 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5B887E043D for ; Sat, 20 Aug 2016 20:45:41 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 0B59D3A0373 for ; Sat, 20 Aug 2016 20:45:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1757030 - /httpd/httpd/trunk/server/mpm/event/event.c Date: Sat, 20 Aug 2016 20:45:40 -0000 To: cvs@httpd.apache.org From: sf@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160820204541.0B59D3A0373@svn01-us-west.apache.org> archived-at: Sat, 20 Aug 2016 20:45:45 -0000 Author: sf Date: Sat Aug 20 20:45:40 2016 New Revision: 1757030 URL: http://svn.apache.org/viewvc?rev=1757030&view=rev Log: mpm_event: minor code simplification - move variable initializations into declarations - use max_workers variable Modified: httpd/httpd/trunk/server/mpm/event/event.c Modified: httpd/httpd/trunk/server/mpm/event/event.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1757030&r1=1757029&r2=1757030&view=diff ============================================================================== --- httpd/httpd/trunk/server/mpm/event/event.c (original) +++ httpd/httpd/trunk/server/mpm/event/event.c Sat Aug 20 20:45:40 2016 @@ -2813,23 +2813,16 @@ static void startup_children(int number_ 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_maintena /* 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)