diff options
Diffstat (limited to '')
-rw-r--r-- | atomic/unix/mutex64.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/atomic/unix/mutex64.c b/atomic/unix/mutex64.c index 9fc44af..4ea4d8f 100644 --- a/atomic/unix/mutex64.c +++ b/atomic/unix/mutex64.c @@ -17,7 +17,7 @@ #include "apr_arch_atomic.h" #include "apr_thread_mutex.h" -#if defined(USE_ATOMICS_GENERIC) || defined (NEED_ATOMICS_GENERIC64) +#if defined(USE_ATOMICS_GENERIC64) #include <stdlib.h> @@ -96,7 +96,14 @@ apr_status_t apr__atomic_generic64_init(apr_pool_t *p) APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem) { - return *mem; + apr_uint64_t cur_value; + DECLARE_MUTEX_LOCKED(mutex, mem); + + cur_value = *mem; + + MUTEX_UNLOCK(mutex); + + return cur_value; } APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val) |