hotspot/src/share/vm/utilities/taskqueue.hpp
changeset 2010 c13462bbad17
parent 2005 42075507972b
child 2105 347008ce7984
--- a/hotspot/src/share/vm/utilities/taskqueue.hpp	Fri Feb 06 01:38:50 2009 +0300
+++ b/hotspot/src/share/vm/utilities/taskqueue.hpp	Sun Feb 08 13:18:01 2009 -0800
@@ -426,12 +426,20 @@
 // A class to aid in the termination of a set of parallel tasks using
 // TaskQueueSet's for work stealing.
 
+#undef TRACESPINNING
+
 class ParallelTaskTerminator: public StackObj {
 private:
   int _n_threads;
   TaskQueueSetSuper* _queue_set;
   int _offered_termination;
 
+#ifdef TRACESPINNING
+  static uint _total_yields;
+  static uint _total_spins;
+  static uint _total_peeks;
+#endif
+
   bool peek_in_queue_set();
 protected:
   virtual void yield();
@@ -462,6 +470,12 @@
   // the terminator is finished.
   void reset_for_reuse();
 
+#ifdef TRACESPINNING
+  static uint total_yields() { return _total_yields; }
+  static uint total_spins() { return _total_spins; }
+  static uint total_peeks() { return _total_peeks; }
+  static void print_termination_counts();
+#endif
 };
 
 #define SIMPLE_STACK 0