+2008-02-24 Hans Boehm <Hans.Boehm@hp.com>
+
+ * win32_threads.c (GC_delete_gc_thread, GC_delete_thread):
+ Consistently call CloseHandle. (GC_suspend): Call
+ GC_delete_gc_thread.
+ * tests/test.c: Don't reference GC_print_stats if not exported.
+
2008-02-20 Hans Boehm <Hans.Boehm@hp.com>
* tests/test.c (run_one_test): Don't mention pthread_self().
# if defined(MSWIN32) || defined(MSWINCE)
# include <windows.h>
+# ifdef GC_DLL
+# define GC_print_stats 0 /* Not exported from DLL */
+ /* Redefine to 1 to generate output. */
+# endif
# endif
# ifdef PCR
/* thread being deleted. */
void GC_delete_gc_thread(GC_vthread gc_id)
{
+ CloseHandle(gc_id->handle);
if (GC_win32_dll_threads) {
/* This is intended to be lock-free. */
/* It is either called synchronously from the thread being deleted, */
/* or by the joining thread. */
/* In this branch asynchronosu changes to *gc_id are possible. */
- CloseHandle(gc_id->handle);
gc_id -> stack_base = 0;
gc_id -> id = 0;
# ifdef CYGWIN32
prev = p;
p = p -> next;
}
+ CloseHandle(p->handle);
if (prev == 0) {
GC_threads[hv] = p -> next;
} else {
# ifndef GC_PTHREADS
/* this breaks pthread_join on Cygwin, which is guaranteed to */
/* only see user pthreads */
- AO_store(&(t -> in_use), FALSE);
- CloseHandle(t -> handle);
+ GC_ASSERT(GC_win32_dll_threads);
+ GC_delete_gc_thread(t);
# endif
return;
}