6885993: Named Thread: introduce print() and print_on(outputStream* st) methods

Eliminating duplicated code by introducing print_on(outputStream* st) methods in NamedThread

Reviewed-by: twisti, coleenp, dholmes
This commit is contained in:
Zhengyu Gu 2014-05-01 05:52:28 -07:00
parent a792009a9f
commit 16a3e2f16d
14 changed files with 14 additions and 62 deletions

View file

@ -46,6 +46,8 @@ ConcurrentMarkThread::ConcurrentMarkThread(ConcurrentMark* cm) :
_in_progress(false),
_vtime_accum(0.0),
_vtime_mark_accum(0.0) {
set_name("G1 Main Concurrent Mark GC Thread");
create_and_start();
}
@ -322,16 +324,6 @@ void ConcurrentMarkThread::stop() {
}
}
void ConcurrentMarkThread::print() const {
print_on(tty);
}
void ConcurrentMarkThread::print_on(outputStream* st) const {
st->print("\"G1 Main Concurrent Mark GC Thread\" ");
Thread::print_on(st);
st->cr();
}
void ConcurrentMarkThread::sleepBeforeNextCycle() {
// We join here because we don't want to do the "shouldConcurrentMark()"
// below while the world is otherwise stopped.