Mercurial > hg > truffle
comparison src/share/vm/memory/gcLocker.inline.hpp @ 18041:52b4284cb496
Merge with jdk8u20-b26
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 15 Oct 2014 16:02:50 +0200 |
parents | 9c3dc501b5eb |
children |
comparison
equal
deleted
inserted
replaced
17606:45d7b2c7029d | 18041:52b4284cb496 |
---|---|
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 | 29 |
30 inline void GC_locker::lock() { | |
31 // cast away volatile | |
32 Atomic::inc(&_lock_count); | |
33 CHECK_UNHANDLED_OOPS_ONLY( | |
34 if (CheckUnhandledOops) { Thread::current()->_gc_locked_out_count++; }) | |
35 assert(Universe::heap() == NULL || | |
36 !Universe::heap()->is_gc_active(), "locking failed"); | |
37 } | |
38 | |
39 inline void GC_locker::unlock() { | |
40 // cast away volatile | |
41 Atomic::dec(&_lock_count); | |
42 CHECK_UNHANDLED_OOPS_ONLY( | |
43 if (CheckUnhandledOops) { Thread::current()->_gc_locked_out_count--; }) | |
44 } | |
45 | |
46 inline void GC_locker::lock_critical(JavaThread* thread) { | 30 inline void GC_locker::lock_critical(JavaThread* thread) { |
47 if (!thread->in_critical()) { | 31 if (!thread->in_critical()) { |
48 if (needs_gc()) { | 32 if (needs_gc()) { |
49 // jni_lock call calls enter_critical under the lock so that the | 33 // jni_lock call calls enter_critical under the lock so that the |
50 // global lock count and per thread count are in agreement. | 34 // global lock count and per thread count are in agreement. |