src/hotspot/share/runtime/objectMonitor.inline.hpp
changeset 57734 18f4d3d46d54
parent 55345 492b644bb9c2
child 57777 90ead0febf56
equal deleted inserted replaced
57733:be8c11fc16bb 57734:18f4d3d46d54
    75 
    75 
    76 inline void ObjectMonitor::set_object(void* obj) {
    76 inline void ObjectMonitor::set_object(void* obj) {
    77   _object = obj;
    77   _object = obj;
    78 }
    78 }
    79 
    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
    80 // return number of threads contending for this monitor
    94 inline jint ObjectMonitor::contentions() const {
    81 inline jint ObjectMonitor::contentions() const {
    95   return _contentions;
    82   return _contentions;
    96 }
    83 }
    97 
    84