mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8140600: Convert unnecessarily malloc'd Monitors to value members
Change a malloc'd monitor into an embedded monitor. Reviewed-by: tschatzl, kbarrett
This commit is contained in:
parent
9e60be45df
commit
dbaa70361f
2 changed files with 12 additions and 12 deletions
|
@ -57,21 +57,21 @@ void G1YoungRemSetSamplingThread::stop() {
|
|||
}
|
||||
}
|
||||
|
||||
G1YoungRemSetSamplingThread::G1YoungRemSetSamplingThread() : ConcurrentGCThread() {
|
||||
_monitor = new Monitor(Mutex::nonleaf,
|
||||
"G1YoungRemSetSamplingThread monitor",
|
||||
true,
|
||||
Monitor::_safepoint_check_never);
|
||||
|
||||
G1YoungRemSetSamplingThread::G1YoungRemSetSamplingThread() :
|
||||
ConcurrentGCThread(),
|
||||
_monitor(Mutex::nonleaf,
|
||||
"G1YoungRemSetSamplingThread monitor",
|
||||
true,
|
||||
Monitor::_safepoint_check_never) {
|
||||
set_name("G1 Young RemSet Sampling");
|
||||
create_and_start();
|
||||
}
|
||||
|
||||
void G1YoungRemSetSamplingThread::sleep_before_next_cycle() {
|
||||
MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag);
|
||||
MutexLockerEx x(&_monitor, Mutex::_no_safepoint_check_flag);
|
||||
if (!_should_terminate) {
|
||||
intx waitms = G1ConcRefinementServiceIntervalMillis; // 300, really should be?
|
||||
_monitor->wait(Mutex::_no_safepoint_check_flag, waitms);
|
||||
_monitor.wait(Mutex::_no_safepoint_check_flag, waitms);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,8 +92,8 @@ void G1YoungRemSetSamplingThread::run_service() {
|
|||
}
|
||||
|
||||
void G1YoungRemSetSamplingThread::stop_service() {
|
||||
MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag);
|
||||
_monitor->notify();
|
||||
MutexLockerEx x(&_monitor, Mutex::_no_safepoint_check_flag);
|
||||
_monitor.notify();
|
||||
}
|
||||
|
||||
void G1YoungRemSetSamplingThread::sample_young_list_rs_lengths() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 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
|
||||
|
@ -41,7 +41,7 @@
|
|||
// increase the young gen size to keep pause time length goal.
|
||||
class G1YoungRemSetSamplingThread: public ConcurrentGCThread {
|
||||
private:
|
||||
Monitor* _monitor;
|
||||
Monitor _monitor;
|
||||
|
||||
void sample_young_list_rs_lengths();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue