Examples of lockInterruptibly()


Examples of com.hazelcast.core.ILock.lockInterruptibly()

        final CountDownLatch latch = new CountDownLatch(1);
        lock.lock();
        Thread t = new Thread() {
            public void run() {
                try {
                    lock.lockInterruptibly();
                } catch (InterruptedException e) {
                    latch.countDown();
                }
            }
        };
View Full Code Here

Examples of edu.emory.mathcs.backport.java.util.concurrent.locks.Lock.lockInterruptibly()

                       ResourceRequestDeniedException {

        final Lock lock = this.lockManager.getLock(coschedid);

        try {
            lock.lockInterruptibly();
        } catch (InterruptedException e) {
            throw new WorkspaceDatabaseException(
                        new LockAcquisitionFailure(e));
        }
View Full Code Here

Examples of edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantLock.lockInterruptibly()

            }
        }

        public Object take() throws InterruptedException {
            final ReentrantLock lock = this.lock;
            lock.lockInterruptibly();
            try {
                for (;;) {
                    RunnableScheduledFuture first = queue[0];
                    if (first == null)
                        available.await();
View Full Code Here

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

      {
         Lock lock = existing.getLock();
        
         try
         {
            lock.lockInterruptibly();
         }
         catch (InterruptedException ie)
         {
            Thread.currentThread().interrupt();
            this.log.info(ie);
View Full Code Here

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

               // 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

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

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

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

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

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

    }

    public void execute(final Runnable task) throws RejectedExecutionException {
        final Lock lock = this.lock;
        try {
            lock.lockInterruptibly();
            try {
                for (;;) {
                    if (stop) {
                        throw new RejectedExecutionException("Executor is stopped");
                    }
View Full Code Here

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

        }
    }

    public boolean awaitTermination(final long timeout, final TimeUnit unit) throws InterruptedException {
        final Lock lock = this.lock;
        lock.lockInterruptibly();
        try {
            if (workers.contains(Thread.currentThread())) {
                throw new IllegalStateException("Cannot await termination of a thread pool from one of its threads");
            }
            final long start = System.currentTimeMillis();
View Full Code Here

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

  {
    if (!this.isAlive(database, Level.DEBUG)) return false;
   
    Lock lock = this.lockManager.writeLock(null);
   
    lock.lockInterruptibly();
   
    try
    {
      if (this.balancer.contains(database)) return false;
     
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.