From: Ivan Maidanski Date: Thu, 29 Dec 2011 14:50:57 +0000 (+0400) Subject: Merge branch 'thread-dbg-msg-extend' X-Git-Tag: gc7_3alpha2~241 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eac81d8c241ec23a6bfcd01cd7e8201e358e3db1;p=gc Merge branch 'thread-dbg-msg-extend' --- eac81d8c241ec23a6bfcd01cd7e8201e358e3db1 diff --cc pthread_stop_world.c index af7f9b1e,274a73cc..b5796167 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@@ -312,10 -311,9 +311,10 @@@ GC_INNER void GC_push_all_stacks(void pthread_t self = pthread_self(); word total_size = 0; - if (!GC_thr_initialized) GC_thr_init(); + if (!EXPECT(GC_thr_initialized, TRUE)) + GC_thr_init(); # ifdef DEBUG_THREADS - GC_log_printf("Pushing stacks from thread 0x%x\n", (unsigned)self); + GC_log_printf("Pushing stacks from thread %p\n", (void *)self); # endif for (i = 0; i < THREAD_TABLE_SZ; i++) { for (p = GC_threads[i]; p != 0; p = p -> next) { diff --cc pthread_support.c index c7df3741,dabaed1a..7e8bf505 --- a/pthread_support.c +++ b/pthread_support.c @@@ -474,9 -491,12 +492,12 @@@ STATIC GC_thread GC_new_thread(pthread_ int hv = NUMERIC_THREAD_ID(id) % THREAD_TABLE_SZ; GC_thread result; static GC_bool first_thread_used = FALSE; + # ifdef DEBUG_THREADS + GC_log_printf("Creating thread %p\n", (void *)id); + # endif GC_ASSERT(I_HOLD_LOCK()); - if (!first_thread_used) { + if (!EXPECT(first_thread_used, TRUE)) { result = &first_thread; first_thread_used = TRUE; } else {