diff options
-rw-r--r-- | pthread_support.c | 5 | ||||
-rw-r--r-- | win32_threads.c | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/pthread_support.c b/pthread_support.c index b301e720..8738732d 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -762,10 +762,11 @@ STATIC void GC_remove_all_threads_but_me(void) { pthread_t self = pthread_self(); int hv; - GC_thread p, next, me; for (hv = 0; hv < THREAD_TABLE_SZ; ++hv) { - me = 0; + GC_thread p, next; + GC_thread me = NULL; + for (p = GC_threads[hv]; 0 != p; p = next) { next = p -> next; if (THREAD_EQUAL(p -> id, self) diff --git a/win32_threads.c b/win32_threads.c index a2a8203e..5e470a76 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -1033,12 +1033,14 @@ GC_API void * GC_CALL GC_call_with_gc_active(GC_fn_type fn, STATIC void GC_remove_all_threads_but_me(void) { int hv; - GC_thread p, next, me = NULL; + GC_thread me = NULL; DWORD thread_id; pthread_t pthread_id = pthread_self(); /* same as in parent */ GC_ASSERT(!GC_win32_dll_threads); for (hv = 0; hv < THREAD_TABLE_SZ; ++hv) { + GC_thread p, next; + for (p = GC_threads[hv]; 0 != p; p = next) { next = p -> tm.next; if (THREAD_EQUAL(p -> pthread_id, pthread_id) |