mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8039147: Cleanup SuspendibleThreadSet
Reviewed-by: brutisso, tschatzl, mgerdin
This commit is contained in:
parent
a3425b64f0
commit
f1edf66ef8
15 changed files with 268 additions and 302 deletions
|
@ -976,11 +976,11 @@ void ConcurrentMark::enter_first_sync_barrier(uint worker_id) {
|
|||
}
|
||||
|
||||
if (concurrent()) {
|
||||
ConcurrentGCThread::stsLeave();
|
||||
SuspendibleThreadSet::leave();
|
||||
}
|
||||
_first_overflow_barrier_sync.enter();
|
||||
if (concurrent()) {
|
||||
ConcurrentGCThread::stsJoin();
|
||||
SuspendibleThreadSet::join();
|
||||
}
|
||||
// at this point everyone should have synced up and not be doing any
|
||||
// more work
|
||||
|
@ -1024,11 +1024,11 @@ void ConcurrentMark::enter_second_sync_barrier(uint worker_id) {
|
|||
}
|
||||
|
||||
if (concurrent()) {
|
||||
ConcurrentGCThread::stsLeave();
|
||||
SuspendibleThreadSet::leave();
|
||||
}
|
||||
_second_overflow_barrier_sync.enter();
|
||||
if (concurrent()) {
|
||||
ConcurrentGCThread::stsJoin();
|
||||
SuspendibleThreadSet::join();
|
||||
}
|
||||
// at this point everything should be re-initialized and ready to go
|
||||
|
||||
|
@ -1076,7 +1076,7 @@ public:
|
|||
|
||||
double start_vtime = os::elapsedVTime();
|
||||
|
||||
ConcurrentGCThread::stsJoin();
|
||||
SuspendibleThreadSet::join();
|
||||
|
||||
assert(worker_id < _cm->active_tasks(), "invariant");
|
||||
CMTask* the_task = _cm->task(worker_id);
|
||||
|
@ -1103,9 +1103,9 @@ public:
|
|||
if (!_cm->has_aborted() && the_task->has_aborted()) {
|
||||
sleep_time_ms =
|
||||
(jlong) (elapsed_vtime_sec * _cm->sleep_factor() * 1000.0);
|
||||
ConcurrentGCThread::stsLeave();
|
||||
SuspendibleThreadSet::leave();
|
||||
os::sleep(Thread::current(), sleep_time_ms, false);
|
||||
ConcurrentGCThread::stsJoin();
|
||||
SuspendibleThreadSet::join();
|
||||
}
|
||||
double end_time2_sec = os::elapsedTime();
|
||||
double elapsed_time2_sec = end_time2_sec - start_time_sec;
|
||||
|
@ -1123,7 +1123,7 @@ public:
|
|||
the_task->record_end_time();
|
||||
guarantee(!the_task->has_aborted() || _cm->has_aborted(), "invariant");
|
||||
|
||||
ConcurrentGCThread::stsLeave();
|
||||
SuspendibleThreadSet::leave();
|
||||
|
||||
double end_vtime = os::elapsedVTime();
|
||||
_cm->update_accum_task_vtime(worker_id, end_vtime - start_vtime);
|
||||
|
@ -3302,21 +3302,17 @@ void ConcurrentMark::print_on_error(outputStream* st) const {
|
|||
|
||||
// We take a break if someone is trying to stop the world.
|
||||
bool ConcurrentMark::do_yield_check(uint worker_id) {
|
||||
if (should_yield()) {
|
||||
if (SuspendibleThreadSet::should_yield()) {
|
||||
if (worker_id == 0) {
|
||||
_g1h->g1_policy()->record_concurrent_pause();
|
||||
}
|
||||
cmThread()->yield();
|
||||
SuspendibleThreadSet::yield();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool ConcurrentMark::should_yield() {
|
||||
return cmThread()->should_yield();
|
||||
}
|
||||
|
||||
bool ConcurrentMark::containing_card_is_marked(void* p) {
|
||||
size_t offset = pointer_delta(p, _g1h->reserved_region().start(), 1);
|
||||
return _card_bm.at(offset >> CardTableModRefBS::card_shift);
|
||||
|
@ -3605,7 +3601,7 @@ void CMTask::regular_clock_call() {
|
|||
#endif // _MARKING_STATS_
|
||||
|
||||
// (4) We check whether we should yield. If we have to, then we abort.
|
||||
if (_cm->should_yield()) {
|
||||
if (SuspendibleThreadSet::should_yield()) {
|
||||
// We should yield. To do this we abort the task. The caller is
|
||||
// responsible for yielding.
|
||||
set_has_aborted();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue