< prev index next >

src/hotspot/share/runtime/lightweightSynchronizer.cpp

Print this page
*** 621,12 ***
  
    if (obj->klass()->is_value_based()) {
      ObjectSynchronizer::handle_sync_on_value_based_class(obj, locking_thread);
    }
  
-   locking_thread->inc_held_monitor_count();
- 
    CacheSetter cache_setter(locking_thread, lock);
  
    LockStack& lock_stack = locking_thread->lock_stack();
  
    ObjectMonitor* monitor = nullptr;
--- 621,10 ---

*** 649,12 ***
  
    if (obj->klass()->is_value_based()) {
      ObjectSynchronizer::handle_sync_on_value_based_class(obj, current);
    }
  
-   current->inc_held_monitor_count();
- 
    CacheSetter cache_setter(current, lock);
  
    // Used when deflation is observed. Progress here requires progress
    // from the deflator. After observing that the deflator is not
    // making progress (after two yields), switch to sleeping.
--- 647,10 ---

*** 1184,20 ***
  
  #ifndef _LP64
    // Only for 32bit which has limited support for fast locking outside the runtime.
    if (lock_stack.try_recursive_enter(obj)) {
      // Recursive lock successful.
-     current->inc_held_monitor_count();
      return true;
    }
  
    if (mark.is_unlocked()) {
      markWord locked_mark = mark.set_fast_locked();
      if (obj->cas_set_mark(locked_mark, mark) == mark) {
        // Successfully fast-locked, push object to lock-stack and return.
        lock_stack.push(obj);
-       current->inc_held_monitor_count();
        return true;
      }
    }
  #endif
  
--- 1180,18 ---

*** 1211,11 ***
      }
  
      if (monitor->try_enter(current)) {
        // ObjectMonitor enter successful.
        cache_setter.set_monitor(monitor);
-       current->inc_held_monitor_count();
        return true;
      }
    }
  
    // Slow-path.
--- 1205,10 ---
< prev index next >