8079579: Add SuspendibleThreadSetLeaver and make SuspendibleThreadSet::joint()/leave() private

Reviewed-by: brutisso, david
This commit is contained in:
Per Lidén 2015-05-11 13:57:30 +02:00
parent 5b29324b68
commit 95da544d68
5 changed files with 90 additions and 65 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 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
@ -77,7 +77,7 @@ void ConcurrentG1RefineThread::initialize() {
}
void ConcurrentG1RefineThread::sample_young_list_rs_lengths() {
SuspendibleThreadSetJoiner sts;
SuspendibleThreadSetJoiner sts_join;
G1CollectedHeap* g1h = G1CollectedHeap::heap();
G1CollectorPolicy* g1p = g1h->g1_policy();
if (g1p->adaptive_young_list_length()) {
@ -89,8 +89,8 @@ void ConcurrentG1RefineThread::sample_young_list_rs_lengths() {
// we try to yield every time we visit 10 regions
if (regions_visited == 10) {
if (sts.should_yield()) {
sts.yield();
if (sts_join.should_yield()) {
sts_join.yield();
// we just abandon the iteration
break;
}
@ -188,7 +188,7 @@ void ConcurrentG1RefineThread::run() {
}
{
SuspendibleThreadSetJoiner sts;
SuspendibleThreadSetJoiner sts_join;
do {
int curr_buffer_num = (int)dcqs.completed_buffers_num();