Examples of OwnableReentrantLock


Examples of org.infinispan.util.concurrent.locks.OwnableReentrantLock

   }

   @Override
   protected void initLocks(int numLocks) {
      sharedLocks = new OwnableReentrantLock[numLocks];
      for (int i = 0; i < numLocks; i++) sharedLocks[i] = new OwnableReentrantLock();
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.OwnableReentrantLock

      return sharedLocks[hashToIndex(object)];
   }

   @Override
   public final boolean ownsLock(Object object, Object owner) {
      OwnableReentrantLock lock = getLock(object);
      return owner.equals(lock.getOwner());
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.OwnableReentrantLock

      return owner.equals(lock.getOwner());
   }

   @Override
   public final boolean isLocked(Object object) {
      OwnableReentrantLock lock = getLock(object);
      return lock.isLocked();
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.OwnableReentrantLock

      super(concurrencyLevel);
   }

   @Override
   protected OwnableReentrantLock newLock() {
      return new OwnableReentrantLock();
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.OwnableReentrantLock

      return new OwnableReentrantLock();
   }

   @Override
   public boolean ownsLock(Object key, Object owner) {
      OwnableReentrantLock l = getLockFromMap(key);
      return l != null && owner.equals(l.getOwner());
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.OwnableReentrantLock

      return l != null && owner.equals(l.getOwner());
   }

   @Override
   public boolean isLocked(Object key) {
      OwnableReentrantLock l = getLockFromMap(key);
      return l != null && l.isLocked();
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.OwnableReentrantLock

         @Override
         public void run() {
            final Object otherOwner = new Object();
            for (int i =0; i < 10; i++) {
               try {
                  final OwnableReentrantLock ownableReentrantLock = lc.acquireLock(otherOwner, k2, 500, TimeUnit.MILLISECONDS);
                  log.trace("ownableReentrantLock = " + ownableReentrantLock);
                  if (ownableReentrantLock != null) return;
               } catch (InterruptedException e) {
                  e.printStackTrace();
               }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.OwnableReentrantLock

         @Override
         public void run() {
            final Object otherOwner = new Object();
            for (int i =0; i < 10; i++) {
               try {
                  final OwnableReentrantLock ownableReentrantLock = lc.acquireLock(otherOwner, k2, 500, TimeUnit.MILLISECONDS);
                  log.trace("ownableReentrantLock = " + ownableReentrantLock);
                  if (ownableReentrantLock != null) return;
               } catch (InterruptedException e) {
                  e.printStackTrace();
               }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.OwnableReentrantLock

      super(concurrencyLevel);
      this.icc = icc;
   }

   protected Lock newLock() {
      return new OwnableReentrantLock(icc);
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.OwnableReentrantLock

   protected Lock newLock() {
      return new OwnableReentrantLock(icc);
   }

   public boolean ownsLock(Object key, Object owner) {
      OwnableReentrantLock l = getLockFromMap(key);
      return l != null && owner.equals(l.getOwner());
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.