apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1481186 - /apr/apr/trunk/memory/unix/apr_pools.c
Date Fri, 10 May 2013 20:58:54 GMT
Author: sf
Date: Fri May 10 20:58:54 2013
New Revision: 1481186

URL: http://svn.apache.org/r1481186
Log:
Pool debugging fixes

- avoid using a destroyed mutex in apr_pool_clear()
- if we create a sub-pool, we don't need to own the pool.

Modified:
    apr/apr/trunk/memory/unix/apr_pools.c

Modified: apr/apr/trunk/memory/unix/apr_pools.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/memory/unix/apr_pools.c?rev=1481186&r1=1481185&r2=1481186&view=diff
==============================================================================
--- apr/apr/trunk/memory/unix/apr_pools.c (original)
+++ apr/apr/trunk/memory/unix/apr_pools.c Fri May 10 20:58:54 2013
@@ -1742,6 +1742,11 @@ APR_DECLARE(void) apr_pool_clear_debug(a
      * the mutex we obtained above.
      */
     if (mutex != pool->mutex) {
+        /*
+         * Prevent apr_palloc() in apr_thread_mutex_create() from trying to
+         * use the destroyed mutex.
+         */
+        pool->mutex = NULL;
         (void)apr_thread_mutex_create(&pool->mutex,
                                       APR_THREAD_MUTEX_NESTED, pool);
 
@@ -1818,7 +1823,7 @@ APR_DECLARE(apr_status_t) apr_pool_creat
         parent = global_pool;
     }
     else {
-       apr_pool_check_integrity(parent);
+       apr_pool_check_lifetime(parent);
 
        if (!allocator)
            allocator = parent->allocator;



Mime
View raw message