rbb 01/01/06 07:18:48
Modified: . CHANGES
lib apr_pools.c
Log:
Keep apr_terminate from seg faulting on terminate. This is
happening on systems that do not NULL out locks when they are
destroyed. To keep this from happening, we set the locks to
NULL after destroying them in apr_terminate, and we have to
check for NULL in free_blocks.
Submitted by: Allan Edwards and Gregory Nicholls <[EMAIL PROTECTED]>
Revision Changes Path
1.36 +7 -0 apr/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apr/CHANGES,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- CHANGES 2001/01/02 01:33:05 1.35
+++ CHANGES 2001/01/06 15:18:47 1.36
@@ -1,5 +1,12 @@
Changes with APR b1
+ *) Keep apr_terminate from seg faulting on terminate. This is
+ happening on systems that do not NULL out locks when they are
+ destroyed. To keep this from happening, we set the locks to
+ NULL after destroying them in apr_terminate, and we have to
+ check for NULL in free_blocks.
+ [Allan Edwards and Gregory Nicholls <[EMAIL PROTECTED]>]
+
*) Remove the ability to allocate memory out of a NULL pool.
[Ryan Bloom]
1.82 +8 -2 apr/lib/apr_pools.c
Index: apr_pools.c
===================================================================
RCS file: /home/cvs/apr/lib/apr_pools.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- apr_pools.c 2001/01/05 00:13:21 1.81
+++ apr_pools.c 2001/01/06 15:18:48 1.82
@@ -328,7 +328,9 @@
}
#if APR_HAS_THREADS
- apr_lock(alloc_mutex);
+ if (alloc_mutex) {
+ apr_lock(alloc_mutex);
+ }
#endif
old_free_list = block_freelist;
block_freelist = blok;
@@ -378,7 +380,9 @@
#endif /* ALLOC_STATS */
#if APR_HAS_THREADS
- apr_unlock(alloc_mutex);
+ if (alloc_mutex) {
+ apr_unlock(alloc_mutex);
+ }
#endif /* APR_HAS_THREADS */
#endif /* ALLOC_USE_MALLOC */
}
@@ -702,6 +706,8 @@
#if APR_HAS_THREADS
apr_destroy_lock(alloc_mutex);
apr_destroy_lock(spawn_mutex);
+ alloc_mutex = NULL;
+ spawn_mutex = NULL;
#endif
apr_destroy_pool(globalp);
}