summaryrefslogtreecommitdiff
path: root/memory/unix/apr_pools.c
diff options
context:
space:
mode:
authorstriker <striker@13f79535-47bb-0310-9956-ffa450edef68>2003-09-27 23:51:46 +0000
committerstriker <striker@13f79535-47bb-0310-9956-ffa450edef68>2003-09-27 23:51:46 +0000
commite5bdfddcef0dc08a30523ce51e81bfbc2f98b1fd (patch)
tree6b2932bbaa3cefca31555ba891f9b1a99f954826 /memory/unix/apr_pools.c
parentad70bcfdaf0ed9490682ce9a74109a17811e371f (diff)
downloadlibapr-e5bdfddcef0dc08a30523ce51e81bfbc2f98b1fd.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/trunk@64655 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'memory/unix/apr_pools.c')
-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) {