diff options
| author | thorpej <thorpej@NetBSD.org> | 2003-01-18 10:52:16 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2003-01-18 10:52:16 +0000 |
| commit | 3fdac2b8c50898b48f2ca25502d8dd95e58978e8 (patch) | |
| tree | 0cf82071885cd198b38bb06cf7bb44da7e1275d1 /lib/libc/stdlib/malloc.c | |
| parent | c62a74e6d5cfb2fb5034e98b983da7e2fc87709d (diff) | |
Merge the nathanw_sa branch.
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
| -rw-r--r-- | lib/libc/stdlib/malloc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 900764e5b1e..e5e70e2f8a3 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $NetBSD: malloc.c,v 1.40 2002/12/09 14:14:59 chris Exp $ */ +/* $NetBSD: malloc.c,v 1.41 2003/01/18 11:32:03 thorpej Exp $ */ /* * ---------------------------------------------------------------------------- @@ -71,6 +71,12 @@ void utrace __P((struct ut *, int)); #include <sys/cdefs.h> #include <sys/types.h> int utrace __P((const char *, void *, size_t)); + +#include <reentrant.h> +extern int __isthreaded; +static mutex_t thread_lock = MUTEX_INITIALIZER; +#define THREAD_LOCK() if (__isthreaded) mutex_lock(&thread_lock); +#define THREAD_UNLOCK() if (__isthreaded) mutex_unlock(&thread_lock); #endif /* __NetBSD__ */ #if defined(__sparc__) && defined(sun) |
