Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.Lock.lockInterruptibly()


    {
        Lock lock = new DummyLock();

        lock.lock();
        lock.unlock();
        lock.lockInterruptibly();

        assertNull(lock.newCondition());
        assertTrue(lock.tryLock());
        assertTrue(lock.tryLock(0, null));
    }
View Full Code Here


  {
    if (!this.isAlive(database)) return false;
   
    Lock lock = this.lockManager.writeLock(null);
   
    lock.lockInterruptibly();
   
    try
    {
      if (this.balancer.contains(database)) return false;
     
View Full Code Here

      Lock lock = record.getLock();

      try
      {
         lock.lockInterruptibly();
      }
      catch (InterruptedException e)
      {
         throw new RuntimeException("Unable to get synchronization", e);
      }
View Full Code Here

      TransactionSynchronizationRegistry tsr = getTransactionSynchronizationRegistry();
      Lock lock = getLock();
     
      try
      {
         lock.lockInterruptibly();
      }
      catch (InterruptedException ie)
      {
         Thread.interrupted();
        
View Full Code Here

      TransactionSynchronizationRegistry tsr = getTransactionSynchronizationRegistry();
      Lock lock = getLock();
      try
      {
         lock.lockInterruptibly();
      }
      catch (InterruptedException ie)
      {
         Thread.interrupted();
View Full Code Here

               // The lock may need to be initialized if we are in the first lazy enlistment
               Lock lock = getLock();
               try
               {
                  lock.lockInterruptibly();
               }
               catch (Throwable t)
               {
                  rethrowAsSystemException("Unable to begin transaction with JCA lazy enlistment scenario",
                                           tx, t);
View Full Code Here

      TransactionSynchronizationRegistry tsr = getTransactionSynchronizationRegistry();
      Lock lock = getLock();
     
      try
      {
         lock.lockInterruptibly();
      }
      catch (InterruptedException ie)
      {
         throw new ResourceException(bundle.unableObtainLock(), ie);
      }
View Full Code Here

      TransactionSynchronizationRegistry tsr = getTransactionSynchronizationRegistry();
      Lock lock = getLock();
      try
      {
         lock.lockInterruptibly();
      }
      catch (InterruptedException ie)
      {
         throw new ResourceException(bundle.unableObtainLock(), ie);
      }
View Full Code Here

    protected boolean closed = false;

    @Override
    public final T take() throws InterruptedException {
        final Lock lock = readWriteLock.readLock();
        lock.lockInterruptibly();
        try {
            if (closed)
                return null;
            T value = _take();
View Full Code Here

      Lock lock = record.getLock();

      try
      {
         lock.lockInterruptibly();
      }
      catch (InterruptedException e)
      {
         throw new RuntimeException("Unable to get synchronization", e);
      }
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.