59
60 public:
61 // Constructor
62 G1ConcurrentMarkThread(G1ConcurrentMark* cm);
63
64 // Total virtual time so far for this thread and concurrent marking tasks.
65 double vtime_accum();
66 // Marking virtual time so far this thread and concurrent marking tasks.
67 double vtime_mark_accum();
68
69 G1ConcurrentMark* cm() { return _cm; }
70
71 void set_idle() { assert(_state != Started, "must not be starting a new cycle"); _state = Idle; }
72 bool idle() { return _state == Idle; }
73 void set_started() { assert(_state == Idle, "cycle in progress"); _state = Started; }
74 bool started() { return _state == Started; }
75 void set_in_progress() { assert(_state == Started, "must be starting a cycle"); _state = InProgress; }
76 bool in_progress() { return _state == InProgress; }
77
78 // Returns true from the moment a marking cycle is
79 // initiated (during the initial-mark pause when started() is set)
80 // to the moment when the cycle completes (just after the next
81 // marking bitmap has been cleared and in_progress() is
82 // cleared). While during_cycle() is true we will not start another cycle
83 // so that cycles do not overlap. We cannot use just in_progress()
84 // as the CM thread might take some time to wake up before noticing
85 // that started() is set and set in_progress().
86 bool during_cycle() { return !idle(); }
87 };
88
89 #endif // SHARE_GC_G1_G1CONCURRENTMARKTHREAD_HPP
|
59
60 public:
61 // Constructor
62 G1ConcurrentMarkThread(G1ConcurrentMark* cm);
63
64 // Total virtual time so far for this thread and concurrent marking tasks.
65 double vtime_accum();
66 // Marking virtual time so far this thread and concurrent marking tasks.
67 double vtime_mark_accum();
68
69 G1ConcurrentMark* cm() { return _cm; }
70
71 void set_idle() { assert(_state != Started, "must not be starting a new cycle"); _state = Idle; }
72 bool idle() { return _state == Idle; }
73 void set_started() { assert(_state == Idle, "cycle in progress"); _state = Started; }
74 bool started() { return _state == Started; }
75 void set_in_progress() { assert(_state == Started, "must be starting a cycle"); _state = InProgress; }
76 bool in_progress() { return _state == InProgress; }
77
78 // Returns true from the moment a marking cycle is
79 // initiated (during the concurrent start pause when started() is set)
80 // to the moment when the cycle completes (just after the next
81 // marking bitmap has been cleared and in_progress() is
82 // cleared). While during_cycle() is true we will not start another cycle
83 // so that cycles do not overlap. We cannot use just in_progress()
84 // as the CM thread might take some time to wake up before noticing
85 // that started() is set and set in_progress().
86 bool during_cycle() { return !idle(); }
87 };
88
89 #endif // SHARE_GC_G1_G1CONCURRENTMARKTHREAD_HPP
|