< prev index next >
src/share/vm/gc/g1/concurrentG1RefineThread.cpp
Print this page
rev 10389 : imported patch webrev.01
rev 10391 : [mq]: webrev.03
@@ -76,11 +76,11 @@
}
void ConcurrentG1RefineThread::wait_for_completed_buffers() {
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag);
- while (!_should_terminate && !is_active()) {
+ while (!should_terminate() && !is_active()) {
_monitor->wait(Mutex::_no_safepoint_check_flag);
}
}
bool ConcurrentG1RefineThread::is_active() {
@@ -107,26 +107,17 @@
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
dcqs.set_process_completed(false);
}
}
-void ConcurrentG1RefineThread::run() {
- initialize_in_thread();
- wait_for_universe_init();
-
- run_service();
-
- terminate();
-}
-
void ConcurrentG1RefineThread::run_service() {
_vtime_start = os::elapsedVTime();
- while (!_should_terminate) {
+ while (!should_terminate()) {
// Wait for work
wait_for_completed_buffers();
- if (_should_terminate) {
+ if (should_terminate()) {
break;
}
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
log_debug(gc, refine)("Activated %d, on threshold: " SIZE_FORMAT ", current: " SIZE_FORMAT,
@@ -166,26 +157,9 @@
}
log_debug(gc, refine)("Stopping %d", _worker_id);
}
-void ConcurrentG1RefineThread::stop() {
- // it is ok to take late safepoints here, if needed
- {
- MutexLockerEx mu(Terminator_lock);
- _should_terminate = true;
- }
-
- stop_service();
-
- {
- MutexLockerEx mu(Terminator_lock);
- while (!_has_terminated) {
- Terminator_lock->wait();
- }
- }
-}
-
void ConcurrentG1RefineThread::stop_service() {
MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag);
_monitor->notify();
}
< prev index next >