diff options
author | hboehm <hboehm> | 2008-02-24 21:25:02 +0100 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2011-07-26 19:06:42 +0200 |
commit | 6c835afcfbb74a26b84bc717102f4772db649cc4 (patch) | |
tree | 11de340dee60674a7732a629982525e03fa62acf | |
parent | ded8d688b3a1ac6dd17026c0aff9cc8e5ff69f52 (diff) |
2008-02-24 Hans Boehm <Hans.Boehm@hp.com>gc7_1alpha3-20080224
* 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.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | tests/test.c | 4 | ||||
-rw-r--r-- | win32_threads.c | 7 |
3 files changed, 15 insertions, 3 deletions
@@ -1,3 +1,10 @@ +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(). diff --git a/tests/test.c b/tests/test.c index 059eb10..6033541 100644 --- a/tests/test.c +++ b/tests/test.c @@ -43,6 +43,10 @@ # 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 diff --git a/win32_threads.c b/win32_threads.c index d5ca89f..272af63 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -488,12 +488,12 @@ static GC_thread GC_lookup_thread(DWORD thread_id) /* 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 @@ -551,6 +551,7 @@ void GC_delete_thread(DWORD id) prev = p; p = p -> next; } + CloseHandle(p->handle); if (prev == 0) { GC_threads[hv] = p -> next; } else { @@ -705,8 +706,8 @@ void GC_suspend(GC_thread t) # 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; } |