summaryrefslogtreecommitdiff
path: root/memory
diff options
context:
space:
mode:
authorSander Striker <striker@apache.org>2003-09-27 23:51:46 +0000
committerSander Striker <striker@apache.org>2003-09-27 23:51:46 +0000
commit23b1af772d4c28e49b52db576d395efe83cba001 (patch)
tree6b2932bbaa3cefca31555ba891f9b1a99f954826 /memory
parentb93c322095a3bf11faea4564949ac7c9794b52de (diff)
downloadapr-23b1af772d4c28e49b52db576d395efe83cba001.tar.gz
* misc/unix/start.c
(apr_initialize): Remove atomics initialization from this function. Due to circular dependency, doing it here is too late. * memory/unix/apr_pools.c (apr_pool_initialize): Add atomics initialization to the release and debug versions. This has to happen here, since pools rely on mutexes, which can be backed by atomics. Atomics initialization requires a pool. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64655 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'memory')
-rw-r--r--memory/unix/apr_pools.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
index 8f2372d76..caa8c8401 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) {