diff options
Diffstat (limited to 'memory/unix/apr_pools.c')
-rw-r--r-- | memory/unix/apr_pools.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index d10012114..d350ac665 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -555,6 +555,13 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) apr_pool_tag(global_pool, "apr_global_pool"); + /* This has to happen here because mutexes might be backed by + * atomics. It used to be snug and safe in apr_initialize(). + */ + if ((rv = apr_atomic_init(global_pool)) != APR_SUCCESS) { + return rv; + } + #if APR_HAS_THREADS { apr_thread_mutex_t *mutex; @@ -1266,6 +1273,13 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void) apr_pools_initialized = 1; + /* This has to happen here because mutexes might be backed by + * atomics. It used to be snug and safe in apr_initialize(). + */ + if ((rv = apr_atomic_init(global_pool)) != APR_SUCCESS) { + return rv; + } + #if (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) apr_file_open_stderr(&file_stderr, global_pool); if (file_stderr) { |