apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stri...@apache.org
Subject cvs commit: apr/memory/unix apr_pools.c
Date Tue, 19 Mar 2002 15:30:07 GMT
striker     02/03/19 07:30:07

  Modified:    memory/unix apr_pools.c
  Log:
  Fix the fix...
  
  apr_allocator_destroy wasn't the one using the invalid lock, it was
  apr_allocator_free, which was being called a few lines above my
  previous fix.
  
  Revision  Changes    Path
  1.163     +9 -7      apr/memory/unix/apr_pools.c
  
  Index: apr_pools.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v
  retrieving revision 1.162
  retrieving revision 1.163
  diff -u -r1.162 -r1.163
  --- apr_pools.c	19 Mar 2002 10:03:45 -0000	1.162
  +++ apr_pools.c	19 Mar 2002 15:30:07 -0000	1.163
  @@ -677,6 +677,15 @@
       allocator = pool->allocator;
       active = pool->self;
   
  +#if APR_HAS_THREADS
  +    if (apr_allocator_get_owner(allocator) == pool) {
  +        /* Make sure to remove the lock, since it is highly likely to
  +         * be invalid now.
  +         */
  +        apr_allocator_set_mutex(allocator, NULL);
  +    }
  +#endif /* APR_HAS_THREADS */
  +
       /* Free all the nodes in the pool (including the node holding the
        * pool struct), by giving them back to the allocator.
        */
  @@ -688,13 +697,6 @@
        * in the allocator, it will have been destroyed by the cleanup function.
        */
       if (apr_allocator_get_owner(allocator) == pool) {
  -#if APR_HAS_THREADS
  -        /* Make sure to remove the lock, since it is highly likely to
  -         * be invalid now.
  -         */
  -        apr_allocator_set_mutex(allocator, NULL);
  -#endif /* APR_HAS_THREADS */
  -
           apr_allocator_destroy(allocator);
       }
   }
  
  
  

Mime
View raw message