From 0452589b7088d685f746fadbf198a895c41ebc30 Mon Sep 17 00:00:00 2001 From: ivmai Date: Fri, 16 Apr 2010 08:45:41 +0000 Subject: [PATCH] 2010-04-16 Ivan Maidanski (mostly really NIIBE Yutaka) * pthread_support.c (GC_mark_thread_local_free_lists, GC_check_tls): Mark (and check) only for live threads (in case of GC_destroy_thread_local() is called already but GC_delete_thread() is not yet). * win32_threads.c (GC_mark_thread_local_free_lists, GC_check_tls): Ditto (matters only if GC_PTHREADS defined). --- ChangeLog | 9 +++++++++ pthread_support.c | 8 +++++--- win32_threads.c | 13 ++++++++----- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39ccf2e4..ed86a501 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-04-16 Ivan Maidanski (mostly really NIIBE Yutaka) + + * pthread_support.c (GC_mark_thread_local_free_lists, + GC_check_tls): Mark (and check) only for live threads (in case of + GC_destroy_thread_local() is called already but GC_delete_thread() + is not yet). + * win32_threads.c (GC_mark_thread_local_free_lists, GC_check_tls): + Ditto (matters only if GC_PTHREADS defined). + 2010-04-09 Ivan Maidanski * NT_MAKEFILE: Remove the comment about DLL and Win32S. diff --git a/pthread_support.c b/pthread_support.c index 627a9927..8048a50c 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -227,7 +227,8 @@ GC_INNER void GC_mark_thread_local_free_lists(void) for (i = 0; i < THREAD_TABLE_SZ; ++i) { for (p = GC_threads[i]; 0 != p; p = p -> next) { - GC_mark_thread_local_fls_for(&(p->tlfs)); + if (!(p -> flags & FINISHED)) + GC_mark_thread_local_fls_for(&(p->tlfs)); } } } @@ -238,7 +239,7 @@ GC_INNER void GC_mark_thread_local_free_lists(void) void GC_check_tsd_marks(tsd *key); # endif /* Check that all thread-local free-lists are completely marked. */ - /* also check that thread-specific-data structures are marked. */ + /* Also check that thread-specific-data structures are marked. */ void GC_check_tls(void) { int i; @@ -246,7 +247,8 @@ GC_INNER void GC_mark_thread_local_free_lists(void) for (i = 0; i < THREAD_TABLE_SZ; ++i) { for (p = GC_threads[i]; 0 != p; p = p -> next) { - GC_check_tls_for(&(p->tlfs)); + if (!(p -> flags & FINISHED)) + GC_check_tls_for(&(p->tlfs)); } } # if defined(USE_CUSTOM_SPECIFIC) diff --git a/win32_threads.c b/win32_threads.c index 38635825..7ad84db6 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -2681,10 +2681,12 @@ GC_INNER void GC_init_parallel(void) for (i = 0; i < THREAD_TABLE_SZ; ++i) { for (p = GC_threads[i]; 0 != p; p = p -> tm.next) { -# ifdef DEBUG_THREADS - GC_printf("Marking thread locals for 0x%x\n", (int)p -> id); -# endif - GC_mark_thread_local_fls_for(&(p->tlfs)); + if (!KNOWN_FINISHED(p)) { +# ifdef DEBUG_THREADS + GC_printf("Marking thread locals for 0x%x\n", (int)p -> id); +# endif + GC_mark_thread_local_fls_for(&(p->tlfs)); + } } } } @@ -2703,7 +2705,8 @@ GC_INNER void GC_init_parallel(void) for (i = 0; i < THREAD_TABLE_SZ; ++i) { for (p = GC_threads[i]; 0 != p; p = p -> tm.next) { - GC_check_tls_for(&(p->tlfs)); + if (!KNOWN_FINISHED(p)) + GC_check_tls_for(&(p->tlfs)); } } # if defined(USE_CUSTOM_SPECIFIC) -- 2.40.0