aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2007-07-29 10:12:32 +0000
committerJan Djärv2007-07-29 10:12:32 +0000
commit784c147269df476f3b1e13d458072e22f97aafa7 (patch)
treed7467e1327af497ddcca0ae94883b2b924288ba2 /src
parent40aa8257e0032ab475923f1925d75dfc7c8a8706 (diff)
downloademacs-784c147269df476f3b1e13d458072e22f97aafa7.tar.gz
emacs-784c147269df476f3b1e13d458072e22f97aafa7.zip
(__malloc_initialize): Remove pthread_once. Not needed.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/gmalloc.c9
2 files changed, 7 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a8dd3891b73..43c9a9f6686 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12007-07-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * gmalloc.c (__malloc_initialize): Remove pthread_once. Not needed.
4
12007-07-28 Nick Roberts <nickrob@snap.net.nz> 52007-07-28 Nick Roberts <nickrob@snap.net.nz>
2 6
3 * xdisp.c (decode_mode_spec): Use '@' instead of 'R' to test for 7 * xdisp.c (decode_mode_spec): Use '@' instead of 'R' to test for
diff --git a/src/gmalloc.c b/src/gmalloc.c
index fcd9f655321..cf79b9159f2 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -561,7 +561,6 @@ register_heapinfo ()
561} 561}
562 562
563#ifdef USE_PTHREAD 563#ifdef USE_PTHREAD
564static pthread_once_t malloc_init_once_control = PTHREAD_ONCE_INIT;
565pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER; 564pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER;
566pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER; 565pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER;
567#endif 566#endif
@@ -607,18 +606,16 @@ malloc_initialize_1 ()
607 return; 606 return;
608} 607}
609 608
610/* Set everything up and remember that we have. */ 609/* Set everything up and remember that we have.
610 main will call malloc which calls this function. That is before any threads
611 or signal handlers has been set up, so we don't need thread protection. */
611int 612int
612__malloc_initialize () 613__malloc_initialize ()
613{ 614{
614#ifdef USE_PTHREAD
615 pthread_once (&malloc_init_once_control, malloc_initialize_1);
616#else
617 if (__malloc_initialized) 615 if (__malloc_initialized)
618 return 0; 616 return 0;
619 617
620 malloc_initialize_1 (); 618 malloc_initialize_1 ();
621#endif
622 619
623 return __malloc_initialized; 620 return __malloc_initialized;
624} 621}