Code example for ReentrantLock

Methods: isLocked

0
      return lock.isHeldByCurrentThread();
   } 
 
   public final boolean isLocked(Object object) {
      ReentrantLock lock = getLock(object);
      return lock.isLocked();
   } 
 
   public String toString() {
      return "ReentrantStripedLockContainer{" + 
            "sharedLocks=" + (sharedLocks == null ? null : Arrays.asList(sharedLocks)) +
            '}'; 
   } 
}