mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8079579: Add SuspendibleThreadSetLeaver and make SuspendibleThreadSet::joint()/leave() private
Reviewed-by: brutisso, david
This commit is contained in:
parent
5b29324b68
commit
95da544d68
5 changed files with 90 additions and 65 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue