< prev index next >
src/hotspot/share/runtime/objectMonitor.inline.hpp
Print this page
rev 54572 : Checkpoint latest preliminary review patches for full OpenJDK review; merge with 8222295.patch.
rev 54573 : imported patch dcubed.monitor_deflate_conc.v2.01
rev 54574 : imported patch dcubed.monitor_deflate_conc.v2.02
*** 161,179 ****
inline void ObjectMonitor::dec_ref_count() {
// The decrement only needs to be MO_ACQ_REL since the reference
// counter is volatile.
Atomic::dec(&_ref_count);
! guarantee(_ref_count >= 0, "sanity check: ref_count=%d", _ref_count);
}
inline void ObjectMonitor::inc_ref_count() {
// The increment needs to be MO_SEQ_CST so that the reference
// counter update is seen as soon as possible in a race with the
// async deflation protocol.
Atomic::inc(&_ref_count);
! guarantee(_ref_count > 0, "sanity check: ref_count=%d", _ref_count);
}
inline jint ObjectMonitor::ref_count() const {
return OrderAccess::load_acquire(&_ref_count);
}
--- 161,183 ----
inline void ObjectMonitor::dec_ref_count() {
// The decrement only needs to be MO_ACQ_REL since the reference
// counter is volatile.
Atomic::dec(&_ref_count);
! // Can be negative as part of async deflation protocol.
! guarantee(AsyncDeflateIdleMonitors || _ref_count >= 0,
! "sanity check: ref_count=%d", _ref_count);
}
inline void ObjectMonitor::inc_ref_count() {
// The increment needs to be MO_SEQ_CST so that the reference
// counter update is seen as soon as possible in a race with the
// async deflation protocol.
Atomic::inc(&_ref_count);
! // Can be negative as part of async deflation protocol.
! guarantee(AsyncDeflateIdleMonitors || _ref_count > 0,
! "sanity check: ref_count=%d", _ref_count);
}
inline jint ObjectMonitor::ref_count() const {
return OrderAccess::load_acquire(&_ref_count);
}
< prev index next >