Skip to content

Commit c3a3fb2

Browse files
author
Xiaolong Peng
committed
8386312: Shenandoah: Incorrect assertion in ShenandoahAllocRate uses is_locked() instead of owned_by_self()
Reviewed-by: wkemper, ruili
1 parent bcbe32f commit c3a3fb2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/hotspot/share/gc/shenandoah/shenandoahAllocRate.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class ShenandoahAllocRate {
174174
void take_sample(jlong now, jlong elapsed, size_t unsampled);
175175

176176
double upper_bound_no_lock(const double standard_deviations) const {
177-
assert(_sample_lock.is_locked(), "Caller must hold lock");
177+
assert(_sample_lock.owned_by_self(), "Caller must hold lock");
178178
return _baseline.weighted_average() + standard_deviations * _baseline.weighted_sd();
179179
}
180180
};

src/hotspot/share/gc/shenandoah/shenandoahAllocRate.inline.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void ShenandoahAllocRate<Clock>::force_update() {
114114

115115
template<typename Clock>
116116
void ShenandoahAllocRate<Clock>::take_sample(jlong now, jlong elapsed, size_t unsampled) {
117-
assert(_sample_lock.is_locked(), "Caller must hold lock");
117+
assert(_sample_lock.owned_by_self(), "Caller must hold lock");
118118

119119
_last_sample_time = now;
120120

0 commit comments

Comments
 (0)