diff options
| author | Jan Djärv | 2007-07-29 10:12:32 +0000 |
|---|---|---|
| committer | Jan Djärv | 2007-07-29 10:12:32 +0000 |
| commit | 784c147269df476f3b1e13d458072e22f97aafa7 (patch) | |
| tree | d7467e1327af497ddcca0ae94883b2b924288ba2 /src/gmalloc.c | |
| parent | 40aa8257e0032ab475923f1925d75dfc7c8a8706 (diff) | |
| download | emacs-784c147269df476f3b1e13d458072e22f97aafa7.tar.gz emacs-784c147269df476f3b1e13d458072e22f97aafa7.zip | |
(__malloc_initialize): Remove pthread_once. Not needed.
Diffstat (limited to 'src/gmalloc.c')
| -rw-r--r-- | src/gmalloc.c | 9 |
1 files changed, 3 insertions, 6 deletions
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 |
| 564 | static pthread_once_t malloc_init_once_control = PTHREAD_ONCE_INIT; | ||
| 565 | pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER; | 564 | pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER; |
| 566 | pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER; | 565 | pthread_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. */ | ||
| 611 | int | 612 | int |
| 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 | } |