From 275a4c4e6fd115a0eb4c7a15e9ac4a92414cd839 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 7 Dec 2006 23:24:19 +0000 Subject: Major cleanup of internal mutex locking. Be more consistant in how we do things, and avoid potential deadlocks caused when a thread holding a uClibc internal lock get canceled and terminates without releasing the lock. This change also provides a single place, bits/uClibc_mutex.h, for thread libraries to modify to change all instances of internal locking. --- libc/stdlib/malloc/heap.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libc/stdlib/malloc/heap.h') diff --git a/libc/stdlib/malloc/heap.h b/libc/stdlib/malloc/heap.h index b66b5ecef..ad891fafb 100644 --- a/libc/stdlib/malloc/heap.h +++ b/libc/stdlib/malloc/heap.h @@ -16,7 +16,7 @@ /* On multi-threaded systems, the heap includes a lock. */ #ifdef __UCLIBC_HAS_THREADS__ -# include +# include # define HEAP_USE_LOCKING #endif @@ -39,7 +39,7 @@ struct heap /* A lock that can be used by callers to control access to the heap. The heap code _does not_ use this lock, it's merely here for the convenience of users! */ - pthread_mutex_t lock; + __UCLIBC_MUTEX_TYPE lock; #endif }; @@ -135,8 +135,8 @@ extern void __heap_dump (struct heap *heap, const char *str); extern void __heap_check (struct heap *heap, const char *str); -#define __heap_lock(heap) __pthread_mutex_lock (&(heap)->lock) -#define __heap_unlock(heap) __pthread_mutex_unlock (&(heap)->lock) +#define __heap_lock(heap) __UCLIBC_MUTEX_LOCK (&(heap)->lock) +#define __heap_unlock(heap) __UCLIBC_MUTEX_UNLOCK (&(heap)->lock) /* Delete the free-area FA from HEAP. */ -- cgit v1.2.3