src/share/vm/memory/gcLocker.inline.hpp

Print this page
rev 6521 : 8044775: Improve usage of umbrella header atomic.inline.hpp.

*** 24,33 **** --- 24,49 ---- #ifndef SHARE_VM_MEMORY_GCLOCKER_INLINE_HPP #define SHARE_VM_MEMORY_GCLOCKER_INLINE_HPP #include "memory/gcLocker.hpp" + #include "runtime/atomic.inline.hpp" + + // In debug mode track the locking state at all times + inline void GC_locker::increment_debug_jni_lock_count() { + #ifdef ASSERT + assert(_debug_jni_lock_count >= 0, "bad value"); + Atomic::inc(&_debug_jni_lock_count); + #endif + } + + inline void GC_locker::decrement_debug_jni_lock_count() { + #ifdef ASSERT + assert(_debug_jni_lock_count > 0, "bad value"); + Atomic::dec(&_debug_jni_lock_count); + #endif + } inline void GC_locker::lock_critical(JavaThread* thread) { if (!thread->in_critical()) { if (needs_gc()) { // jni_lock call calls enter_critical under the lock so that the