From 744842bf666f31cfdd355598c244cef2487eded4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Thu, 22 Apr 2010 05:41:17 +0000 Subject: nptl: fix malloc library locking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update malloc library to use internal uclibc locking primitives to get the libpthread calls correct. Signed-off-by: Timo Teräs Signed-off-by: Austin Foxley --- libc/stdlib/malloc/heap.h | 7 +++---- 1 file changed, 3 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 c0c5df821..30380791f 100644 --- a/libc/stdlib/malloc/heap.h +++ b/libc/stdlib/malloc/heap.h @@ -16,11 +16,10 @@ /* On multi-threaded systems, the heap includes a lock. */ #ifdef __UCLIBC_HAS_THREADS__ -# include -# include +# include # define HEAP_USE_LOCKING -# define __heap_lock(heap_lock) __pthread_mutex_lock (heap_lock) -# define __heap_unlock(heap_lock) __pthread_mutex_unlock (heap_lock) +# define __heap_lock(heap_lock) __UCLIBC_MUTEX_LOCK_CANCEL_UNSAFE(*(heap_lock)) +# define __heap_unlock(heap_lock) __UCLIBC_MUTEX_UNLOCK_CANCEL_UNSAFE(*(heap_lock)) #else # define __heap_lock(heap_lock) # define __heap_unlock(heap_lock) -- cgit v1.2.3