]> git.eshelyaron.com Git - emacs.git/commitdiff
(__malloc_initialize): Remove pthread_once. Not needed.
authorJan Djärv <jan.h.d@swipnet.se>
Sun, 29 Jul 2007 10:12:32 +0000 (10:12 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Sun, 29 Jul 2007 10:12:32 +0000 (10:12 +0000)
src/ChangeLog
src/gmalloc.c

index a8dd3891b73ca50f1e92f2541316f612667b1279..43c9a9f6686b297f90aa300fdd178273fc6169cf 100644 (file)
@@ -1,3 +1,7 @@
+2007-07-29  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * gmalloc.c (__malloc_initialize): Remove pthread_once.  Not needed.
+
 2007-07-28  Nick Roberts  <nickrob@snap.net.nz>
 
        * xdisp.c (decode_mode_spec): Use '@' instead of 'R' to test for
index fcd9f6553215aa02d67b848cff3a762ac379ba32..cf79b9159f2d9f9b1235ad9f9db097045e9ffcab 100644 (file)
@@ -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;
 }