diff src/share/vm/utilities/taskqueue.cpp @ 1833:8b10f48633dc

6984287: Regularize how GC parallel workers are specified. Summary: Associate number of GC workers with the workgang as opposed to the task. Reviewed-by: johnc, ysr
author jmasa
date Mon, 20 Sep 2010 14:38:38 -0700
parents 5f429ee79634
children f95d63e2154a
line wrap: on
line diff
--- a/src/share/vm/utilities/taskqueue.cpp	Thu Sep 16 13:45:55 2010 -0700
+++ b/src/share/vm/utilities/taskqueue.cpp	Mon Sep 20 14:38:38 2010 -0700
@@ -144,6 +144,7 @@
 
 bool
 ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) {
+  assert(_n_threads > 0, "Initialization is incorrect");
   assert(_offered_termination < _n_threads, "Invariant");
   Atomic::inc(&_offered_termination);
 
@@ -255,3 +256,9 @@
     _index < objArrayOop(_obj)->length();
 }
 #endif // ASSERT
+
+void ParallelTaskTerminator::reset_for_reuse(int n_threads) {
+  reset_for_reuse();
+  _n_threads = n_threads;
+}
+