summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc/heap.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-04-22 05:41:17 +0000
committerAustin Foxley <austinf@cetoncorp.com>2010-04-22 08:45:25 -0700
commit744842bf666f31cfdd355598c244cef2487eded4 (patch)
tree525fa9189a8d40454a22b565ea2d9ebd55b8b7d5 /libc/stdlib/malloc/heap.h
parent71239593ef4077b3e3d06a0f21aa5d0697880bef (diff)
nptl: fix malloc library locking
Update malloc library to use internal uclibc locking primitives to get the libpthread calls correct. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/stdlib/malloc/heap.h')
-rw-r--r--libc/stdlib/malloc/heap.h7
1 files changed, 3 insertions, 4 deletions
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 <pthread.h>
-# include <bits/uClibc_pthread.h>
+# include <bits/uClibc_mutex.h>
# 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)