Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 36155 invoked from network); 4 Mar 2011 22:12:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Mar 2011 22:12:43 -0000 Received: (qmail 32704 invoked by uid 500); 4 Mar 2011 22:12:43 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 32649 invoked by uid 500); 4 Mar 2011 22:12:43 -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 32641 invoked by uid 99); 4 Mar 2011 22:12:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 22:12:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 22:12:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 20FDD238890D; Fri, 4 Mar 2011 22:12:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1078170 - in /httpd/httpd/trunk/server/mpm: event/event.c prefork/prefork.c worker/worker.c Date: Fri, 04 Mar 2011 22:12:22 -0000 To: cvs@httpd.apache.org From: trawick@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110304221222.20FDD238890D@eris.apache.org> Author: trawick Date: Fri Mar 4 22:12:21 2011 New Revision: 1078170 URL: http://svn.apache.org/viewvc?rev=1078170&view=rev Log: sanity check use of volatile in prefork, worker, and event Modified: httpd/httpd/trunk/server/mpm/event/event.c httpd/httpd/trunk/server/mpm/prefork/prefork.c httpd/httpd/trunk/server/mpm/worker/worker.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=1078170&r1=1078169&r2=1078170&view=diff ============================================================================== --- httpd/httpd/trunk/server/mpm/event/event.c (original) +++ httpd/httpd/trunk/server/mpm/event/event.c Fri Mar 4 22:12:21 2011 @@ -170,7 +170,7 @@ static fd_queue_t *worker_queue; static fd_queue_info_t *worker_queue_info; static int mpm_state = AP_MPMQ_STARTING; static int sick_child_detected; -static ap_generation_t volatile my_generation = 0; +static ap_generation_t my_generation = 0; static apr_thread_mutex_t *timeout_mutex; APR_RING_HEAD(timeout_head_t, conn_state_t); @@ -443,11 +443,12 @@ static void just_die(int sig) * Connection structures and accounting... */ -/* volatile just in case */ +static int child_fatal; + +/* volatile because they're updated from a signal handler */ static int volatile shutdown_pending; static int volatile restart_pending; static int volatile is_graceful; -static volatile int child_fatal; /* * ap_start_shutdown() and ap_start_restart(), below, are a first stab at Modified: httpd/httpd/trunk/server/mpm/prefork/prefork.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/prefork/prefork.c?rev=1078170&r1=1078169&r2=1078170&view=diff ============================================================================== --- httpd/httpd/trunk/server/mpm/prefork/prefork.c (original) +++ httpd/httpd/trunk/server/mpm/prefork/prefork.c Fri Mar 4 22:12:21 2011 @@ -133,9 +133,7 @@ static apr_pool_t *pchild; static pid_t ap_my_pid; /* it seems silly to call getpid all the time */ static pid_t parent_pid; static int my_child_num; -static ap_generation_t volatile my_generation=0; - -static volatile int die_now = 0; +static ap_generation_t my_generation=0; #ifdef GPROF /* @@ -316,6 +314,12 @@ static void just_die(int sig) clean_child_exit(0); } +/* volatile because they're updated from a signal handler */ +static int volatile shutdown_pending; +static int volatile restart_pending; +static int volatile is_graceful; +static int volatile die_now = 0; + static void stop_listening(int sig) { mpm_state = AP_MPMQ_STOPPING; @@ -325,11 +329,6 @@ static void stop_listening(int sig) die_now = 1; } -/* volatile just in case */ -static int volatile shutdown_pending; -static int volatile restart_pending; -static int volatile is_graceful; - static void sig_term(int sig) { if (shutdown_pending == 1) { Modified: httpd/httpd/trunk/server/mpm/worker/worker.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/worker.c?rev=1078170&r1=1078169&r2=1078170&view=diff ============================================================================== --- httpd/httpd/trunk/server/mpm/worker/worker.c (original) +++ httpd/httpd/trunk/server/mpm/worker/worker.c Fri Mar 4 22:12:21 2011 @@ -133,7 +133,7 @@ static fd_queue_t *worker_queue; static fd_queue_info_t *worker_queue_info; static int mpm_state = AP_MPMQ_STARTING; static int sick_child_detected; -static ap_generation_t volatile my_generation = 0; +static ap_generation_t my_generation = 0; /* data retained by worker across load/unload of the module * allocated on first call to pre-config hook; located on @@ -390,11 +390,12 @@ static void just_die(int sig) * Connection structures and accounting... */ -/* volatile just in case */ +static int child_fatal; + +/* volatile because they're updated from a signal handler */ static int volatile shutdown_pending; static int volatile restart_pending; static int volatile is_graceful; -static volatile int child_fatal; /* * ap_start_shutdown() and ap_start_restart(), below, are a first stab at