< prev index next >
src/share/vm/gc/g1/g1StringDedupThread.cpp
Print this page
rev 10389 : imported patch webrev.01
rev 10391 : [mq]: webrev.03
*** 1,7 ****
/*
! * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 79,104 ****
void G1StringDedupThread::deduplicate_shared_strings(G1StringDedupStat& stat) {
G1StringDedupSharedClosure sharedStringDedup(stat);
StringTable::shared_oops_do(&sharedStringDedup);
}
! void G1StringDedupThread::run() {
G1StringDedupStat total_stat;
- initialize_in_thread();
- wait_for_universe_init();
deduplicate_shared_strings(total_stat);
// Main loop
for (;;) {
G1StringDedupStat stat;
stat.mark_idle();
// Wait for the queue to become non-empty
G1StringDedupQueue::wait();
! if (_should_terminate) {
break;
}
{
// Include thread in safepoints
--- 79,102 ----
void G1StringDedupThread::deduplicate_shared_strings(G1StringDedupStat& stat) {
G1StringDedupSharedClosure sharedStringDedup(stat);
StringTable::shared_oops_do(&sharedStringDedup);
}
! void G1StringDedupThread::run_service() {
G1StringDedupStat total_stat;
deduplicate_shared_strings(total_stat);
// Main loop
for (;;) {
G1StringDedupStat stat;
stat.mark_idle();
// Wait for the queue to become non-empty
G1StringDedupQueue::wait();
! if (should_terminate()) {
break;
}
{
// Include thread in safepoints
*** 131,157 ****
total_stat.add(stat);
print(stat, total_stat);
}
}
- terminate();
}
! void G1StringDedupThread::stop() {
! {
! MonitorLockerEx ml(Terminator_lock);
! _thread->_should_terminate = true;
! }
!
G1StringDedupQueue::cancel_wait();
-
- {
- MonitorLockerEx ml(Terminator_lock);
- while (!_thread->_has_terminated) {
- ml.wait();
- }
- }
}
void G1StringDedupThread::print(const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat) {
if (log_is_enabled(Info, gc, stringdedup)) {
G1StringDedupStat::print_summary(last_stat, total_stat);
--- 129,142 ----
total_stat.add(stat);
print(stat, total_stat);
}
}
}
! void G1StringDedupThread::stop_service() {
G1StringDedupQueue::cancel_wait();
}
void G1StringDedupThread::print(const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat) {
if (log_is_enabled(Info, gc, stringdedup)) {
G1StringDedupStat::print_summary(last_stat, total_stat);
< prev index next >