diff options
author | striker <striker@13f79535-47bb-0310-9956-ffa450edef68> | 2002-01-15 08:29:35 +0000 |
---|---|---|
committer | striker <striker@13f79535-47bb-0310-9956-ffa450edef68> | 2002-01-15 08:29:35 +0000 |
commit | c8fb938ae09dd0568e24acd9e2da0cb2dc5d1b31 (patch) | |
tree | d5ba468d316d565b771d73ee9c6801e5e1e546c4 /memory | |
parent | cba0e7a71cc760df718388815f76935bdb92c78e (diff) | |
download | libapr-c8fb938ae09dd0568e24acd9e2da0cb2dc5d1b31.tar.gz |
Move around the creation of the lock and adding the pool to the
parent pools child list. This gets us a working APR_POOL_DEBUG.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62790 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'memory')
-rw-r--r-- | memory/unix/apr_pools.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 26276eba2..946fc20de 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -1069,7 +1069,7 @@ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *pool, #if defined(APR_POOL_DEBUG_VERBOSE) if (file_stderr) { apr_file_printf(file_stderr, - "POOL DEBUG: CLEAR [%10lu/%10lu/%10lu] " + "POOL DEBUG: CLEAR [%10lu/%10lu/%10lu] " "0x%08X \"%s\" [%s] (%u/%u/%u)\n", (unsigned long)apr_pool_num_bytes(pool, 0), (unsigned long)apr_pool_num_bytes(pool, 1), @@ -1158,6 +1158,27 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, pool->file_line = file_line; pool->creation_flags = flags; + if ((pool->parent = parent) != NULL) { +#if APR_HAS_THREADS + if (parent->mutex) + apr_thread_mutex_lock(parent->mutex); +#endif + if ((pool->sibling = parent->child) != NULL) + pool->sibling->ref = &pool->sibling; + + parent->child = pool; + pool->ref = &parent->child; + +#if APR_HAS_THREADS + if (parent->mutex) + apr_thread_mutex_unlock(parent->mutex); +#endif + } + else { + pool->sibling = NULL; + pool->ref = NULL; + } + if ((flags & APR_POOL_FNEW_ALLOCATOR) == APR_POOL_FNEW_ALLOCATOR) { #if APR_HAS_THREADS apr_status_t rv; @@ -1184,27 +1205,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, #endif } - if ((pool->parent = parent) != NULL) { -#if APR_HAS_THREADS - if (parent->mutex) - apr_thread_mutex_lock(parent->mutex); -#endif - if ((pool->sibling = parent->child) != NULL) - pool->sibling->ref = &pool->sibling; - - parent->child = pool; - pool->ref = &parent->child; - -#if APR_HAS_THREADS - if (parent->mutex) - apr_thread_mutex_unlock(parent->mutex); -#endif - } - else { - pool->sibling = NULL; - pool->ref = NULL; - } - *newpool = pool; #if defined(APR_POOL_DEBUG_VERBOSE) |