summaryrefslogtreecommitdiff
path: root/memory
diff options
context:
space:
mode:
authorstriker <striker@13f79535-47bb-0310-9956-ffa450edef68>2003-09-27 23:58:23 +0000
committerstriker <striker@13f79535-47bb-0310-9956-ffa450edef68>2003-09-27 23:58:23 +0000
commit83ff0df806ed0560f2db83f44c681147f3f015e4 (patch)
treeee57aecc055dbfad03ef4d58e1cfce2b7a018cf4 /memory
parentedf317537330c26f89808f6ede390264ae564437 (diff)
downloadlibapr-83ff0df806ed0560f2db83f44c681147f3f015e4.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: http://svn.apache.org/repos/asf/apr/apr/branches/APR_0_9_BRANCH@64656 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 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) {