diff options
| author | YAMAMOTO Mitsuharu | 2007-08-07 09:04:55 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2007-08-07 09:04:55 +0000 |
| commit | 31521cb0ffcd54a9de93b0b98469618ca5749c81 (patch) | |
| tree | 1309a7bec9e1097b0758c14922b7a3d2e8ccc2aa /src | |
| parent | e490694a089a5afd1002a283c27d53a32d684171 (diff) | |
| download | emacs-31521cb0ffcd54a9de93b0b98469618ca5749c81.tar.gz emacs-31521cb0ffcd54a9de93b0b98469618ca5749c81.zip | |
(__malloc_initialize): Remove pthread_once. Not needed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/gmalloc.c | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index cebb164ecf0..189585d241a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2007-08-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * gmalloc.c (__malloc_initialize): Remove pthread_once. Not needed. | ||
| 4 | |||
| 1 | 2007-08-07 Sam Steingold <sds@gnu.org> | 5 | 2007-08-07 Sam Steingold <sds@gnu.org> |
| 2 | 6 | ||
| 3 | * gmalloc.c (__morecore): Fix the declaration to comply with the | 7 | * 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 () | |||
| 582 | } | 582 | } |
| 583 | 583 | ||
| 584 | #ifdef USE_PTHREAD | 584 | #ifdef USE_PTHREAD |
| 585 | static pthread_once_t malloc_init_once_control = PTHREAD_ONCE_INIT; | ||
| 586 | pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER; | 585 | pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER; |
| 587 | pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER; | 586 | pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER; |
| 588 | int _malloc_thread_enabled_p; | 587 | int _malloc_thread_enabled_p; |
| @@ -656,18 +655,16 @@ malloc_initialize_1 () | |||
| 656 | return; | 655 | return; |
| 657 | } | 656 | } |
| 658 | 657 | ||
| 659 | /* Set everything up and remember that we have. */ | 658 | /* Set everything up and remember that we have. |
| 659 | main will call malloc which calls this function. That is before any threads | ||
| 660 | or signal handlers has been set up, so we don't need thread protection. */ | ||
| 660 | int | 661 | int |
| 661 | __malloc_initialize () | 662 | __malloc_initialize () |
| 662 | { | 663 | { |
| 663 | #ifdef USE_PTHREAD | ||
| 664 | pthread_once (&malloc_init_once_control, malloc_initialize_1); | ||
| 665 | #else | ||
| 666 | if (__malloc_initialized) | 664 | if (__malloc_initialized) |
| 667 | return 0; | 665 | return 0; |
| 668 | 666 | ||
| 669 | malloc_initialize_1 (); | 667 | malloc_initialize_1 (); |
| 670 | #endif | ||
| 671 | 668 | ||
| 672 | return __malloc_initialized; | 669 | return __malloc_initialized; |
| 673 | } | 670 | } |