diff options
-rw-r--r-- | darwin_stop_world.c | 4 | ||||
-rw-r--r-- | pthread_stop_world.c | 1 | ||||
-rw-r--r-- | win32_threads.c | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/darwin_stop_world.c b/darwin_stop_world.c index 76b1e98b..18bbc025 100644 --- a/darwin_stop_world.c +++ b/darwin_stop_world.c @@ -401,7 +401,8 @@ GC_INNER void GC_push_all_stacks(void) for (i = 0; i < THREAD_TABLE_SZ; i++) { GC_thread p; - for (p = GC_threads[i]; p != NULL; p = p -> tm.next) + for (p = GC_threads[i]; p != NULL; p = p -> tm.next) { + GC_ASSERT(THREAD_TABLE_INDEX(p -> id) == i); if (!KNOWN_FINISHED(p)) { thread_act_t thread = (thread_act_t)(p -> mach_thread); ptr_t lo = GC_stack_range_for(&hi, thread, p, my_thread, @@ -418,6 +419,7 @@ GC_INNER void GC_push_all_stacks(void) } nthreads++; } + } } /* for (i=0; ...) */ } diff --git a/pthread_stop_world.c b/pthread_stop_world.c index d45b8a17..0c0c7b53 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -800,6 +800,7 @@ GC_INNER void GC_push_all_stacks(void) # endif GC_stack_context_t crtn = p -> crtn; + GC_ASSERT(THREAD_TABLE_INDEX(p -> id) == i); if (KNOWN_FINISHED(p)) continue; ++nthreads; traced_stack_sect = crtn -> traced_stack_sect; diff --git a/win32_threads.c b/win32_threads.c index d7cbf89b..89c690ba 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -966,13 +966,15 @@ GC_INNER void GC_push_all_stacks(void) for (i = 0; i < THREAD_TABLE_SZ; i++) { GC_thread p; - for (p = GC_threads[i]; p != NULL; p = p -> tm.next) + for (p = GC_threads[i]; p != NULL; p = p -> tm.next) { + GC_ASSERT(THREAD_TABLE_INDEX(p -> id) == i); if (!KNOWN_FINISHED(p)) { # ifndef SMALL_CONFIG ++nthreads; # endif total_size += GC_push_stack_for(p, self_id, &found_me); } + } } } # ifndef SMALL_CONFIG |