hotspot/src/share/vm/gc/shared/workgroup.hpp
changeset 33107 77bf0d2069a3
parent 33105 294e48b4f704
child 35040 d00805788fdd
equal deleted inserted replaced
33106:20c533b9e167 33107:77bf0d2069a3
    26 #define SHARE_VM_GC_SHARED_WORKGROUP_HPP
    26 #define SHARE_VM_GC_SHARED_WORKGROUP_HPP
    27 
    27 
    28 #include "memory/allocation.hpp"
    28 #include "memory/allocation.hpp"
    29 #include "runtime/globals.hpp"
    29 #include "runtime/globals.hpp"
    30 #include "runtime/thread.hpp"
    30 #include "runtime/thread.hpp"
       
    31 #include "gc/shared/gcId.hpp"
    31 #include "utilities/debug.hpp"
    32 #include "utilities/debug.hpp"
    32 #include "utilities/globalDefinitions.hpp"
    33 #include "utilities/globalDefinitions.hpp"
    33 
    34 
    34 // Task class hierarchy:
    35 // Task class hierarchy:
    35 //   AbstractGangTask
    36 //   AbstractGangTask
    52 
    53 
    53 // An abstract task to be worked on by a gang.
    54 // An abstract task to be worked on by a gang.
    54 // You subclass this to supply your own work() method
    55 // You subclass this to supply your own work() method
    55 class AbstractGangTask VALUE_OBJ_CLASS_SPEC {
    56 class AbstractGangTask VALUE_OBJ_CLASS_SPEC {
    56   const char* _name;
    57   const char* _name;
       
    58   const uint _gc_id;
    57 
    59 
    58  public:
    60  public:
    59   AbstractGangTask(const char* name) : _name(name) {}
    61   AbstractGangTask(const char* name) :
       
    62     _name(name),
       
    63     _gc_id(GCId::current_raw())
       
    64  {}
    60 
    65 
    61   // The abstract work method.
    66   // The abstract work method.
    62   // The argument tells you which member of the gang you are.
    67   // The argument tells you which member of the gang you are.
    63   virtual void work(uint worker_id) = 0;
    68   virtual void work(uint worker_id) = 0;
    64 
    69 
    65   // Debugging accessor for the name.
    70   // Debugging accessor for the name.
    66   const char* name() const { return _name; }
    71   const char* name() const { return _name; }
       
    72   const uint gc_id() const { return _gc_id; }
    67 };
    73 };
    68 
    74 
    69 struct WorkData {
    75 struct WorkData {
    70   AbstractGangTask* _task;
    76   AbstractGangTask* _task;
    71   uint              _worker_id;
    77   uint              _worker_id;