24 |
24 |
25 #ifndef SHARE_VM_MEMORY_GCLOCKER_INLINE_HPP |
25 #ifndef SHARE_VM_MEMORY_GCLOCKER_INLINE_HPP |
26 #define SHARE_VM_MEMORY_GCLOCKER_INLINE_HPP |
26 #define SHARE_VM_MEMORY_GCLOCKER_INLINE_HPP |
27 |
27 |
28 #include "memory/gcLocker.hpp" |
28 #include "memory/gcLocker.hpp" |
29 |
|
30 inline bool GC_locker::is_active() { |
|
31 assert(_needs_gc || SafepointSynchronize::is_at_safepoint(), "only read at safepoint"); |
|
32 verify_critical_count(); |
|
33 return _lock_count > 0 || _jni_lock_count > 0; |
|
34 } |
|
35 |
29 |
36 inline void GC_locker::lock() { |
30 inline void GC_locker::lock() { |
37 // cast away volatile |
31 // cast away volatile |
38 Atomic::inc(&_lock_count); |
32 Atomic::inc(&_lock_count); |
39 CHECK_UNHANDLED_OOPS_ONLY( |
33 CHECK_UNHANDLED_OOPS_ONLY( |