8322853: Should use ConditionalMutexLocker in NativeHeapTrimmerThread::print_state
Reviewed-by: dholmes, shade
This commit is contained in:
parent
539da24863
commit
7eb25ec7b3
@ -71,11 +71,6 @@ class NativeHeapTrimmerThread : public NamedThread {
|
||||
return --_suspend_count;
|
||||
}
|
||||
|
||||
bool is_stopped() const {
|
||||
assert(_lock->is_locked(), "Must be");
|
||||
return _stop;
|
||||
}
|
||||
|
||||
bool at_or_nearing_safepoint() const {
|
||||
return SafepointSynchronize::is_at_safepoint() ||
|
||||
SafepointSynchronize::is_synchronizing();
|
||||
@ -215,13 +210,12 @@ public:
|
||||
}
|
||||
|
||||
void print_state(outputStream* st) const {
|
||||
// Don't pull lock during error reporting
|
||||
Mutex* const lock = VMError::is_error_reported() ? nullptr : _lock;
|
||||
int64_t num_trims = 0;
|
||||
bool stopped = false;
|
||||
uint16_t suspenders = 0;
|
||||
{
|
||||
MutexLocker ml(lock, Mutex::_no_safepoint_check_flag);
|
||||
// Don't pull lock during error reporting
|
||||
ConditionalMutexLocker ml(_lock, !VMError::is_error_reported(), Mutex::_no_safepoint_check_flag);
|
||||
num_trims = _num_trims_performed;
|
||||
stopped = _stop;
|
||||
suspenders = _suspend_count;
|
||||
|
Loading…
x
Reference in New Issue
Block a user