]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
fdq expects a certain behavior from atomics... ensure that
authorJim Jagielski <jim@apache.org>
Fri, 16 Nov 2012 16:49:31 +0000 (16:49 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 16 Nov 2012 16:49:31 +0000 (16:49 +0000)
the event mpms check this.

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

docs/log-message-tags/next-number
server/mpm/event/event.c
server/mpm/eventopt/eventopt.c

index 075c4f664bbc1f0f9cf756cfb5cb1e100182acfd..0af28381aaf23b2f4ad820fcaea6d7abb57fc5d9 100644 (file)
@@ -1 +1 @@
-2405
+2407
index 23aa95d8f75140d8c32a9bdad801daed7c330109..9c18af354cd4f7e85407de663df5fdb352778d78 100644 (file)
@@ -2928,6 +2928,18 @@ static int event_pre_config(apr_pool_t * pconf, apr_pool_t * plog,
     }
     ++retained->module_loads;
     if (retained->module_loads == 2) {
+        int i;
+        static apr_uint32_t foo = 0;
+
+        apr_atomic_inc32(&foo);
+        apr_atomic_dec32(&foo);
+        apr_atomic_dec32(&foo);
+        i = apr_atomic_dec32(&foo);
+        if (i >= 0) {
+            ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, APLOGNO(02405)
+                         "atomics not working as expected");
+            return HTTP_INTERNAL_SERVER_ERROR;
+        }
         rv = apr_pollset_create(&event_pollset, 1, plog,
                                 APR_POLLSET_THREADSAFE | APR_POLLSET_NOCOPY);
         if (rv != APR_SUCCESS) {
index fbf189d5321ecef45b0ba1b988a943bdf391e8d7..2c7891e65e7d3fd888c4b8ae0b1ed76f3154abb4 100644 (file)
@@ -2922,6 +2922,18 @@ static int event_pre_config(apr_pool_t * pconf, apr_pool_t * plog,
     }
     ++retained->module_loads;
     if (retained->module_loads == 2) {
+        int i;
+        static apr_uint32_t foo = 0;
+
+        apr_atomic_inc32(&foo);
+        apr_atomic_dec32(&foo);
+        apr_atomic_dec32(&foo);
+        i = apr_atomic_dec32(&foo);
+        if (i >= 0) {
+            ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL, APLOGNO(02406)
+                         "atomics not working as expected");
+            return HTTP_INTERNAL_SERVER_ERROR;
+        }
         rv = apr_pollset_create(&event_pollset, 1, plog,
                                 APR_POLLSET_WAKEABLE|APR_POLLSET_NOCOPY);
         if (rv != APR_SUCCESS) {