]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mpm_event: avoid unexpected compiler optimizations.
authorYann Ylavic <ylavic@apache.org>
Tue, 2 Jan 2018 15:24:48 +0000 (15:24 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 2 Jan 2018 15:24:48 +0000 (15:24 +0000)
Make sure the compiler doesn't play games with our synchronization variables
by marking them volatile.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1819847 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/event/event.c

index 705d3314e281b58f10deeb13e8ab006ec7358219..a71c3dc35f5757499d0a8bf2a098b4bbc275eff7 100644 (file)
@@ -180,10 +180,10 @@ static int max_workers = 0;                 /* MaxRequestWorkers */
 static int server_limit = 0;                /* ServerLimit */
 static int thread_limit = 0;                /* ThreadLimit */
 static int had_healthy_child = 0;
-static int dying = 0;
-static int workers_may_exit = 0;
-static int start_thread_may_exit = 0;
-static int listener_may_exit = 0;
+static volatile int dying = 0;
+static volatile int workers_may_exit = 0;
+static volatile int start_thread_may_exit = 0;
+static volatile int listener_may_exit = 0;
 static int listener_is_wakeable = 0;        /* Pollset supports APR_POLLSET_WAKEABLE */
 static int num_listensocks = 0;
 static apr_int32_t conns_this_child;        /* MaxConnectionsPerChild, only access