httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
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 GMT
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



Mime
View raw message