about summary refs log tree commit diff
path: root/malloc/arena.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2012-08-17 11:29:45 -0700
committerRoland McGrath <roland@hack.frob.com>2012-08-17 11:29:45 -0700
commit750c1f2a9aefc7b3329283c1b0c95e1a0bb88f14 (patch)
tree2901a662169f86b152d62b3a67b157e89fd022c1 /malloc/arena.c
parent2ae1ae5cf441a90171ff483e3f0de6e8a9d611e4 (diff)
downloadglibc-750c1f2a9aefc7b3329283c1b0c95e1a0bb88f14.tar.gz
glibc-750c1f2a9aefc7b3329283c1b0c95e1a0bb88f14.tar.xz
glibc-750c1f2a9aefc7b3329283c1b0c95e1a0bb88f14.zip
Make malloc build for no-threads configurations.
Diffstat (limited to 'malloc/arena.c')
-rw-r--r--malloc/arena.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index 06bdd77d23..9e5e332020 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -141,6 +141,8 @@ int __malloc_initialized = -1;
 
 /**************************************************************************/
 
+#ifndef NO_THREADS
+
 /* atfork support.  */
 
 static __malloc_ptr_t (*save_malloc_hook) (size_t __size,
@@ -276,7 +278,7 @@ ptmalloc_unlock_all (void)
   (void)mutex_unlock(&list_lock);
 }
 
-#ifdef __linux__
+# ifdef __linux__
 
 /* In NPTL, unlocking a mutex in the child process after a
    fork() is currently unsafe, whereas re-initializing it is safe and
@@ -311,11 +313,13 @@ ptmalloc_unlock_all2 (void)
   atfork_recursive_cntr = 0;
 }
 
-#else
+# else
 
-#define ptmalloc_unlock_all2 ptmalloc_unlock_all
+#  define ptmalloc_unlock_all2 ptmalloc_unlock_all
 
-#endif
+# endif
+
+#endif  /* !NO_THREADS */
 
 /* Initialization routine. */
 #include <string.h>