summaryrefslogtreecommitdiff
path: root/pthread_stop_world.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2007-05-08 00:22:34 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:39 +0200
commitfad1490176c55e21c396f007cfb12b4e9882b716 (patch)
treefe83a00bf469cc1fdb76e442480506e4fd197750 /pthread_stop_world.c
parent1d60500ac7c08e61c2b58a843fd0cfb9e1ec927b (diff)
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.
Diffstat (limited to 'pthread_stop_world.c')
-rw-r--r--pthread_stop_world.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index fb68586..75ef567 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -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.");
}