From 29252f8d07c23f00a1590a576ed110573cebacd2 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Mon, 11 Dec 2006 05:28:24 +0000 Subject: mostly revert the locking changes for 'malloc', as the implementation does not easily lend itself to becoming complete pthread cancelation safe without first investing in some deep and serious thought... The other malloc implementations are pthread cancelation safe, and this one is mostly used for uClinux, where the lack is at least less likely to be a common problem. --- libc/stdlib/malloc/heap.h | 9 +++++---- 1 file changed, 5 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 ad891fafb..23358d988 100644 --- a/libc/stdlib/malloc/heap.h +++ b/libc/stdlib/malloc/heap.h @@ -16,7 +16,8 @@ /* On multi-threaded systems, the heap includes a lock. */ #ifdef __UCLIBC_HAS_THREADS__ -# include +# include +# include # define HEAP_USE_LOCKING #endif @@ -39,7 +40,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! */ - __UCLIBC_MUTEX_TYPE lock; + pthread_mutex_t lock; #endif }; @@ -135,8 +136,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) __UCLIBC_MUTEX_LOCK (&(heap)->lock) -#define __heap_unlock(heap) __UCLIBC_MUTEX_UNLOCK (&(heap)->lock) +#define __heap_lock(heap) __pthread_mutex_lock (&(heap)->lock) +#define __heap_unlock(heap) __pthread_mutex_unlock (&(heap)->lock) /* Delete the free-area FA from HEAP. */ -- cgit v1.2.3