Mercurial > emacs
diff src/gmalloc.c @ 82198:8cc259bc54fd
(__malloc_initialize): Remove pthread_once. Not needed.
| author | Jan Dj?rv <jan.h.d@swipnet.se> |
|---|---|
| date | Sun, 29 Jul 2007 10:12:21 +0000 |
| parents | 059caeb1f502 |
| children | 7856255721ef 539530fa389c |
line wrap: on
line diff
--- a/src/gmalloc.c Sun Jul 29 09:18:15 2007 +0000 +++ b/src/gmalloc.c Sun Jul 29 10:12:21 2007 +0000 @@ -561,7 +561,6 @@ } #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 @@ 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; }
