diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2023-04-06 09:12:20 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2023-04-06 13:17:41 +0300 |
commit | 30b3f419d3eea97ceda2465ea1ef0267752e2f5f (patch) | |
tree | c3f5fc6105eadfe693ef2eff1f15ffc600d60e3a /win32_threads.c | |
parent | fa2cc313eb64cff42a0e1724aee0122be2f034a8 (diff) | |
download | bdwgc-30b3f419d3eea97ceda2465ea1ef0267752e2f5f.tar.gz |
Add assertion to verify GC_threads hash table entries are chained properly
(refactoring)
* darwin_stop_world.c (GC_push_all_stacks): Add assertion that thread
entry is located in the proper hash table chain (by id).
* pthread_stop_world.c (GC_push_all_stacks): Likewise.
* win32_threads.c (GC_push_all_stacks): Likewise.
Diffstat (limited to 'win32_threads.c')
-rw-r--r-- | win32_threads.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 |