summaryrefslogtreecommitdiff
path: root/src/gmalloc.c
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2007-07-29 10:12:32 +0000
committerJan Djärv <jan.h.d@swipnet.se>2007-07-29 10:12:32 +0000
commit784c147269df476f3b1e13d458072e22f97aafa7 (patch)
treed7467e1327af497ddcca0ae94883b2b924288ba2 /src/gmalloc.c
parent40aa8257e0032ab475923f1925d75dfc7c8a8706 (diff)
(__malloc_initialize): Remove pthread_once. Not needed.
Diffstat (limited to 'src/gmalloc.c')
-rw-r--r--src/gmalloc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gmalloc.c b/src/gmalloc.c
index fcd9f65532..cf79b9159f 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -561,7 +561,6 @@ register_heapinfo ()
}
#ifdef USE_PTHREAD
-static pthread_once_t malloc_init_once_control = PTHREAD_ONCE_INIT;
pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
@@ -607,18 +606,16 @@ malloc_initialize_1 ()
return;
}
-/* Set everything up and remember that we have. */
+/* Set everything up and remember that we have.
+ main will call malloc which calls this function. That is before any threads
+ or signal handlers has been set up, so we don't need thread protection. */
int
__malloc_initialize ()
{
-#ifdef USE_PTHREAD
- pthread_once (&malloc_init_once_control, malloc_initialize_1);
-#else
if (__malloc_initialized)
return 0;
malloc_initialize_1 ();
-#endif
return __malloc_initialized;
}