--- a/hotspot/src/share/vm/utilities/taskqueue.cpp Thu Sep 16 13:45:55 2010 -0700
+++ b/hotspot/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;
+}
+