]> granicus.if.org Git - gc/commitdiff
2008-02-24 Hans Boehm <Hans.Boehm@hp.com> gc7_1alpha3-20080224
authorhboehm <hboehm>
Sun, 24 Feb 2008 20:25:02 +0000 (20:25 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:42 +0000 (21:06 +0400)
* 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.

ChangeLog
tests/test.c
win32_threads.c

index 651639893e7a7f99c897255822f09fc7275e2239..980809b911f20668b27929f85fefe327b101eb00 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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().
index 059eb10fffecb623881300f2991b39b432341e37..603354145076d3377d3df9563755954d98261896 100644 (file)
 
 # 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
index d5ca89f0ddc223298cfef5629980f2b396e52b69..272af63a439afeaa74a69b35f5bdb1fbec0eceda 100644 (file)
@@ -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;
     }