]> granicus.if.org Git - gc/commitdiff
2007-05-07 Hans Boehm <Hans.Boehm@hp.com>
authorhboehm <hboehm>
Mon, 7 May 2007 22:22:34 +0000 (22:22 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:39 +0000 (21:06 +0400)
* pthread_stop_world.c (GC_push_all_stacks): Print thread count with
GC_PRINT_VERBOSE_STATS.

ChangeLog
pthread_stop_world.c

index c72447328cc504e0f2f2adbcada000918f7ec63f..5d19ce936f803d11c70369001fca5279b0da477f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-07  Hans Boehm <Hans.Boehm@hp.com>
+
+       * pthread_stop_world.c (GC_push_all_stacks): Print thread count with
+       GC_PRINT_VERBOSE_STATS.
+
 2007-05-01  Hans Boehm <Hans.Boehm@hp.com>
                (and Manuel Serrano, Craig McDaniel)
 
index fb68586c26969759f54abf6d592415165c66c373..75ef567c16cf9504fd4f48bc3e25d470db48db8a 100644 (file)
@@ -242,6 +242,7 @@ void GC_restart_handler(int sig)
 void GC_push_all_stacks()
 {
     GC_bool found_me = FALSE;
+    size_t nthreads = 0;
     int i;
     GC_thread p;
     ptr_t lo, hi;
@@ -256,6 +257,7 @@ void GC_push_all_stacks()
     for (i = 0; i < THREAD_TABLE_SZ; i++) {
       for (p = GC_threads[i]; p != 0; p = p -> next) {
         if (p -> flags & FINISHED) continue;
+       ++nthreads;
         if (pthread_equal(p -> id, me)) {
 #          ifdef SPARC
                lo = (ptr_t)GC_save_regs_in_stack();
@@ -302,6 +304,9 @@ void GC_push_all_stacks()
 #      endif
       }
     }
+    if (GC_print_stats == VERBOSE) {
+       GC_log_printf("Pushed %d thread stacks\n", nthreads);
+    }
     if (!found_me && !GC_in_thread_creation)
       ABORT("Collecting from unknown thread.");
 }