From: Yann Ylavic Date: Tue, 2 Jan 2018 15:24:48 +0000 (+0000) Subject: mpm_event: avoid unexpected compiler optimizations. X-Git-Tag: 2.5.0-alpha2-ci-test-only~3020 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73593abb14b37e257227245052381cdefcb027ec;p=thirdparty%2Fapache%2Fhttpd.git mpm_event: avoid unexpected compiler optimizations. 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 --- diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 705d3314e28..a71c3dc35f5 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -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