38 friend class GCTaskManager;
39 private:
40 // Instance state.
41 GCTaskManager* _manager; // Manager for worker.
42 const uint _processor_id; // Which processor the worker is on.
43
44 GCTaskTimeStamp* _time_stamps;
45 uint _time_stamp_index;
46
47 GCTaskTimeStamp* time_stamp_at(uint index);
48
49 bool _is_working; // True if participating in GC tasks
50
51 // Factory create and destroy methods.
52 static GCTaskThread* create(GCTaskManager* manager,
53 uint which,
54 uint processor_id) {
55 return new GCTaskThread(manager, which, processor_id);
56 }
57 public:
58 static void destroy(GCTaskThread* manager) {
59 if (manager != NULL) {
60 delete manager;
61 }
62 }
63 // Methods from Thread.
64 bool is_GC_task_thread() const {
65 return true;
66 }
67 virtual void run();
68
69 void print_task_time_stamps();
70
71 protected:
72 // Constructor. Clients use factory, but there could be subclasses.
73 GCTaskThread(GCTaskManager* manager, uint which, uint processor_id);
74 // Destructor: virtual destructor because of virtual methods.
75 virtual ~GCTaskThread();
76 // Accessors.
77 GCTaskManager* manager() const {
|
38 friend class GCTaskManager;
39 private:
40 // Instance state.
41 GCTaskManager* _manager; // Manager for worker.
42 const uint _processor_id; // Which processor the worker is on.
43
44 GCTaskTimeStamp* _time_stamps;
45 uint _time_stamp_index;
46
47 GCTaskTimeStamp* time_stamp_at(uint index);
48
49 bool _is_working; // True if participating in GC tasks
50
51 // Factory create and destroy methods.
52 static GCTaskThread* create(GCTaskManager* manager,
53 uint which,
54 uint processor_id) {
55 return new GCTaskThread(manager, which, processor_id);
56 }
57 public:
58 static const char* task_name();
59
60 static void destroy(GCTaskThread* manager) {
61 if (manager != NULL) {
62 delete manager;
63 }
64 }
65 // Methods from Thread.
66 bool is_GC_task_thread() const {
67 return true;
68 }
69 virtual void run();
70
71 void print_task_time_stamps();
72
73 protected:
74 // Constructor. Clients use factory, but there could be subclasses.
75 GCTaskThread(GCTaskManager* manager, uint which, uint processor_id);
76 // Destructor: virtual destructor because of virtual methods.
77 virtual ~GCTaskThread();
78 // Accessors.
79 GCTaskManager* manager() const {
|