< prev index next >

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

Print this page
rev 55936 : [mq]: 8229212.cr0


  60   assert(_recursions == 0, "must be 0: recursions=" INTPTR_FORMAT, _recursions);
  61   assert(_object != NULL, "must be non-NULL");
  62   assert(_owner == NULL, "must be NULL: owner=" INTPTR_FORMAT, p2i(_owner));
  63 
  64   _header = NULL;
  65   _object = NULL;
  66 }
  67 
  68 inline void* ObjectMonitor::object() const {
  69   return _object;
  70 }
  71 
  72 inline void* ObjectMonitor::object_addr() {
  73   return (void *)(&_object);
  74 }
  75 
  76 inline void ObjectMonitor::set_object(void* obj) {
  77   _object = obj;
  78 }
  79 
  80 inline bool ObjectMonitor::check(TRAPS) {
  81   if (THREAD != _owner) {
  82     if (THREAD->is_lock_owned((address) _owner)) {
  83       _owner = THREAD;  // regain ownership of inflated monitor
  84       assert (_recursions == 0, "invariant") ;
  85     } else {
  86       check_slow(THREAD);
  87       return false;
  88     }
  89   }
  90   return true;
  91 }
  92 
  93 // return number of threads contending for this monitor
  94 inline jint ObjectMonitor::contentions() const {
  95   return _contentions;
  96 }
  97 
  98 inline void ObjectMonitor::set_owner(void* owner) {
  99   _owner = owner;
 100 }
 101 
 102 #endif // SHARE_RUNTIME_OBJECTMONITOR_INLINE_HPP


  60   assert(_recursions == 0, "must be 0: recursions=" INTPTR_FORMAT, _recursions);
  61   assert(_object != NULL, "must be non-NULL");
  62   assert(_owner == NULL, "must be NULL: owner=" INTPTR_FORMAT, p2i(_owner));
  63 
  64   _header = NULL;
  65   _object = NULL;
  66 }
  67 
  68 inline void* ObjectMonitor::object() const {
  69   return _object;
  70 }
  71 
  72 inline void* ObjectMonitor::object_addr() {
  73   return (void *)(&_object);
  74 }
  75 
  76 inline void ObjectMonitor::set_object(void* obj) {
  77   _object = obj;
  78 }
  79 













  80 // return number of threads contending for this monitor
  81 inline jint ObjectMonitor::contentions() const {
  82   return _contentions;
  83 }
  84 
  85 inline void ObjectMonitor::set_owner(void* owner) {
  86   _owner = owner;
  87 }
  88 
  89 #endif // SHARE_RUNTIME_OBJECTMONITOR_INLINE_HPP
< prev index next >