1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

Make malloc build for no-threads configurations.

This commit is contained in:
Roland McGrath
2012-08-17 11:29:45 -07:00
parent 2ae1ae5cf4
commit 750c1f2a9a
4 changed files with 25 additions and 12 deletions

View File

@@ -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>