< prev index next >

src/share/vm/gc/shared/workgroup.hpp

Print this page

        

@@ -26,10 +26,11 @@
 #define SHARE_VM_GC_SHARED_WORKGROUP_HPP
 
 #include "memory/allocation.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/thread.hpp"
+#include "gc/shared/gcId.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/globalDefinitions.hpp"
 
 // Task class hierarchy:
 //   AbstractGangTask

@@ -52,20 +53,25 @@
 
 // An abstract task to be worked on by a gang.
 // You subclass this to supply your own work() method
 class AbstractGangTask VALUE_OBJ_CLASS_SPEC {
   const char* _name;
+  const uint _gc_id;
 
  public:
-  AbstractGangTask(const char* name) : _name(name) {}
+  AbstractGangTask(const char* name) :
+    _name(name),
+    _gc_id(GCId::current_raw()) // Use current_raw() here since the G1ParVerifyTask can be called outside of a GC (at VM exit)
+ {}
 
   // The abstract work method.
   // The argument tells you which member of the gang you are.
   virtual void work(uint worker_id) = 0;
 
   // Debugging accessor for the name.
   const char* name() const { return _name; }
+  const uint gc_id() const { return _gc_id; }
 };
 
 struct WorkData {
   AbstractGangTask* _task;
   uint              _worker_id;
< prev index next >