* win32_threads.c (GC_unregister_my_thread,
GC_remove_all_threads_but_me, GC_thread_exit_proc): Invoke
GC_remove_specific (if THREAD_LOCAL_ALLOC) after destroying
thread-local list (same as in pthread_support.c).
/* else */ {
GC_delete_thread(thread_id);
}
+# if defined(THREAD_LOCAL_ALLOC)
+ /* It is required to call remove_specific defined in specific.c. */
+ GC_remove_specific(GC_thread_key);
+# endif
UNLOCK();
}
return GC_SUCCESS;
# ifdef THREAD_LOCAL_ALLOC
if ((p -> flags & FINISHED) == 0) {
GC_destroy_thread_local(&p->tlfs);
+ GC_remove_specific(GC_thread_key);
}
# endif
if (&first_thread != p)
/* deallocate it as part of join */
me -> flags |= FINISHED;
}
+# if defined(THREAD_LOCAL_ALLOC)
+ /* It is required to call remove_specific defined in specific.c. */
+ GC_remove_specific(GC_thread_key);
+# endif
UNLOCK();
}