< prev index next >

src/hotspot/share/runtime/objectMonitor.inline.hpp

Print this page




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_RUNTIME_OBJECTMONITOR_INLINE_HPP
  26 #define SHARE_VM_RUNTIME_OBJECTMONITOR_INLINE_HPP
  27 
  28 inline intptr_t ObjectMonitor::is_entered(TRAPS) const {
  29   if (THREAD == _owner || THREAD->is_lock_owned((address) _owner)) {
  30     return 1;
  31   }
  32   return 0;
  33 }
  34 
  35 inline markOop ObjectMonitor::header() const {
  36   return _header;
  37 }
  38 





  39 inline void ObjectMonitor::set_header(markOop hdr) {
  40   _header = hdr;
  41 }
  42 
  43 inline jint ObjectMonitor::count() const {
  44   return _count;
  45 }
  46 
  47 inline jint ObjectMonitor::waiters() const {
  48   return _waiters;
  49 }
  50 
  51 inline void* ObjectMonitor::owner() const {
  52   return _owner;
  53 }
  54 
  55 inline void ObjectMonitor::clear() {
  56   assert(_header, "Fatal logic error in ObjectMonitor header!");
  57   assert(_count == 0, "Fatal logic error in ObjectMonitor count!");
  58   assert(_waiters == 0, "Fatal logic error in ObjectMonitor waiters!");




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_RUNTIME_OBJECTMONITOR_INLINE_HPP
  26 #define SHARE_VM_RUNTIME_OBJECTMONITOR_INLINE_HPP
  27 
  28 inline intptr_t ObjectMonitor::is_entered(TRAPS) const {
  29   if (THREAD == _owner || THREAD->is_lock_owned((address) _owner)) {
  30     return 1;
  31   }
  32   return 0;
  33 }
  34 
  35 inline markOop ObjectMonitor::header() const {
  36   return _header;
  37 }
  38 
  39 inline volatile markOop* ObjectMonitor::header_addr() {
  40   assert((intptr_t)this == (intptr_t)&_header, "sync code expects this");
  41   return &_header;
  42 }
  43 
  44 inline void ObjectMonitor::set_header(markOop hdr) {
  45   _header = hdr;
  46 }
  47 
  48 inline jint ObjectMonitor::count() const {
  49   return _count;
  50 }
  51 
  52 inline jint ObjectMonitor::waiters() const {
  53   return _waiters;
  54 }
  55 
  56 inline void* ObjectMonitor::owner() const {
  57   return _owner;
  58 }
  59 
  60 inline void ObjectMonitor::clear() {
  61   assert(_header, "Fatal logic error in ObjectMonitor header!");
  62   assert(_count == 0, "Fatal logic error in ObjectMonitor count!");
  63   assert(_waiters == 0, "Fatal logic error in ObjectMonitor waiters!");


< prev index next >