Examples of OwnableReentrantLock


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

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

   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);
                  System.out.println("ownableReentrantLock = " + ownableReentrantLock);
                  if (ownableReentrantLock != null) return;
               } catch (InterruptedException e) {
                  e.printStackTrace();
               }
View Full Code Here

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

    */
   public OwnableReentrantStripedLockContainer(int concurrencyLevel, Equivalence<Object> keyEquivalence) {
      super(keyEquivalence);
      int numLocks = calculateNumberOfSegments(concurrencyLevel);
      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

      return new OwnableRefCountingReentrantLock();
   }

   @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

      initLocks(calculateNumberOfSegments(concurrencyLevel));
   }

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

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

   public final OwnableReentrantLock getLock(Object object) {
      return sharedLocks[hashToIndex(object)];
   }

   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

      OwnableReentrantLock lock = getLock(object);
      return owner.equals(lock.getOwner());
   }

   public final boolean isLocked(Object object) {
      OwnableReentrantLock lock = getLock(object);
      return lock.isLocked();
   }
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.