< prev index next >
src/share/vm/gc/g1/concurrentMarkThread.cpp
Print this page
rev 10389 : imported patch webrev.01
rev 10391 : [mq]: webrev.03
*** 103,131 ****
~GCConcPhaseTimer() {
_cm->register_concurrent_phase_end();
}
};
- void ConcurrentMarkThread::run() {
- initialize_in_thread();
- wait_for_universe_init();
-
- run_service();
-
- terminate();
- }
-
void ConcurrentMarkThread::run_service() {
_vtime_start = os::elapsedVTime();
G1CollectedHeap* g1h = G1CollectedHeap::heap();
G1CollectorPolicy* g1_policy = g1h->g1_policy();
! while (!_should_terminate) {
// wait until started is set.
sleepBeforeNextCycle();
! if (_should_terminate) {
_cm->root_regions()->cancel_scan();
break;
}
assert(GCId::current() != GCId::undefined(), "GC id should have been set up by the initial mark GC.");
--- 103,122 ----
~GCConcPhaseTimer() {
_cm->register_concurrent_phase_end();
}
};
void ConcurrentMarkThread::run_service() {
_vtime_start = os::elapsedVTime();
G1CollectedHeap* g1h = G1CollectedHeap::heap();
G1CollectorPolicy* g1_policy = g1h->g1_policy();
! while (!should_terminate()) {
// wait until started is set.
sleepBeforeNextCycle();
! if (should_terminate()) {
_cm->root_regions()->cancel_scan();
break;
}
assert(GCId::current() != GCId::undefined(), "GC id should have been set up by the initial mark GC.");
*** 291,316 ****
g1h->register_concurrent_cycle_end();
}
}
}
- void ConcurrentMarkThread::stop() {
- {
- MutexLockerEx ml(Terminator_lock);
- _should_terminate = true;
- }
-
- stop_service();
-
- {
- MutexLockerEx ml(Terminator_lock);
- while (!_has_terminated) {
- Terminator_lock->wait();
- }
- }
- }
-
void ConcurrentMarkThread::stop_service() {
MutexLockerEx ml(CGC_lock, Mutex::_no_safepoint_check_flag);
CGC_lock->notify_all();
}
--- 282,291 ----
*** 318,328 ****
// We join here because we don't want to do the "shouldConcurrentMark()"
// below while the world is otherwise stopped.
assert(!in_progress(), "should have been cleared");
MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag);
! while (!started() && !_should_terminate) {
CGC_lock->wait(Mutex::_no_safepoint_check_flag);
}
if (started()) {
set_in_progress();
--- 293,303 ----
// We join here because we don't want to do the "shouldConcurrentMark()"
// below while the world is otherwise stopped.
assert(!in_progress(), "should have been cleared");
MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag);
! while (!started() && !should_terminate()) {
CGC_lock->wait(Mutex::_no_safepoint_check_flag);
}
if (started()) {
set_in_progress();
< prev index next >