summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc/malloc.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2006-12-11 05:28:24 +0000
committerEric Andersen <andersen@codepoet.org>2006-12-11 05:28:24 +0000
commit29252f8d07c23f00a1590a576ed110573cebacd2 (patch)
tree6d24ff054643106c04556125013537ba254b95c4 /libc/stdlib/malloc/malloc.h
parent7e465f90d545ea0b75372aea664804c6cd39ea14 (diff)
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.
Diffstat (limited to 'libc/stdlib/malloc/malloc.h')
-rw-r--r--libc/stdlib/malloc/malloc.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/libc/stdlib/malloc/malloc.h b/libc/stdlib/malloc/malloc.h
index 177d8c236..747e8bf9e 100644
--- a/libc/stdlib/malloc/malloc.h
+++ b/libc/stdlib/malloc/malloc.h
@@ -125,11 +125,12 @@ extern int __malloc_mmb_debug;
/* Locking for multithreaded apps. */
#ifdef __UCLIBC_HAS_THREADS__
-# include <bits/uClibc_mutex.h>
+# include <pthread.h>
+# include <bits/uClibc_pthread.h>
# define MALLOC_USE_LOCKING
-typedef __UCLIBC_MUTEX_TYPE malloc_mutex_t;
+typedef pthread_mutex_t malloc_mutex_t;
# define MALLOC_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
# ifdef MALLOC_USE_SBRK
@@ -138,8 +139,8 @@ typedef __UCLIBC_MUTEX_TYPE malloc_mutex_t;
things will break if these multiple calls are interleaved with another
thread's use of sbrk!). */
extern malloc_mutex_t __malloc_sbrk_lock;
-# define __malloc_lock_sbrk() __UCLIBC_MUTEX_LOCK (&__malloc_sbrk_lock)
-# define __malloc_unlock_sbrk() __UCLIBC_MUTEX_UNLOCK (&__malloc_sbrk_lock)
+# define __malloc_lock_sbrk() __pthread_mutex_lock (&__malloc_sbrk_lock)
+# define __malloc_unlock_sbrk() __pthread_mutex_unlock (&__malloc_sbrk_lock)
# endif /* MALLOC_USE_SBRK */
#else /* !__UCLIBC_HAS_THREADS__ */