emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/gmalloc.c,v [EMACS_22_BASE]


From: YAMAMOTO Mitsuharu
Subject: [Emacs-diffs] Changes to emacs/src/gmalloc.c,v [EMACS_22_BASE]
Date: Tue, 07 Aug 2007 09:04:33 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     YAMAMOTO Mitsuharu <mituharu>   07/08/07 09:04:33

Index: gmalloc.c
===================================================================
RCS file: /sources/emacs/emacs/src/gmalloc.c,v
retrieving revision 1.21.2.3
retrieving revision 1.21.2.4
diff -u -b -r1.21.2.3 -r1.21.2.4
--- gmalloc.c   7 Aug 2007 09:02:05 -0000       1.21.2.3
+++ gmalloc.c   7 Aug 2007 09:04:33 -0000       1.21.2.4
@@ -582,7 +582,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;
 int _malloc_thread_enabled_p;
@@ -656,18 +655,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;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]