From: YAMAMOTO Mitsuharu Date: Tue, 7 Aug 2007 09:04:55 +0000 (+0000) Subject: (__malloc_initialize): Remove pthread_once. Not needed. X-Git-Tag: emacs-pretest-22.1.90~1081 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=31521cb0ffcd54a9de93b0b98469618ca5749c81;p=emacs.git (__malloc_initialize): Remove pthread_once. Not needed. --- diff --git a/src/ChangeLog b/src/ChangeLog index cebb164ecf0..189585d241a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2007-08-07 Jan Dj,Ad(Brv + + * gmalloc.c (__malloc_initialize): Remove pthread_once. Not needed. + 2007-08-07 Sam Steingold * gmalloc.c (__morecore): Fix the declaration to comply with the diff --git a/src/gmalloc.c b/src/gmalloc.c index b1f8513c5fb..ea6ccc4bf1f 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c @@ -582,7 +582,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; int _malloc_thread_enabled_p; @@ -656,18 +655,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; }