Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.Condition.await()


        System.out.println("-- waiting for merge to happen --");
        long target_time=System.currentTimeMillis() + 40000;
        lock.lock();
        try {
            while(System.currentTimeMillis() < target_time && done.get() == false) {
                cond.await(1000, TimeUnit.MILLISECONDS);
            }
        }
        finally {
            lock.unlock();
        }
View Full Code Here


        Thread t = new Thread(){
            @Override
            public void run() {
                try {
                    lock.lock();
                    condition.await();
                    lock.unlock();
                } catch (Exception e) {
                    ex[0]=e;
                }
            }
View Full Code Here

                    }
                }

            });

            condition.await();
        } finally {
            lock.unlock();
        }
    }
   
View Full Code Here

            Thread t=new Thread(){

                public void run() {
                    lock.lock();
                    try {
                        condition.await();
                        awake[0]=true;
                    } catch (InterruptedException e) {
                        exception[0]=e;
                    } finally {
                        lock.unlock();
View Full Code Here

            Thread t2=new Thread(){

                public void run() {
                    lock.lock();
                    try {
                        condition.await();
                        awake[1]=true;
                    } catch (InterruptedException e) {
                        exception[0]=e;
                    } finally {
                        lock.unlock();
View Full Code Here

                if( Display.getCurrent()!=null )
                    return;
                // the issue is being resolved we should wait for it to be resolved.
                while( dialog != null ) {
                    try{
                            condition.await(500, TimeUnit.MILLISECONDS);
                    }catch(InterruptedException e){
                        return;
                    }
                }
                return;
View Full Code Here

      incrementWaiters(guard);
      try {
        final Condition condition = guard.condition;
        do {
          try {
            condition.await();
          } catch (InterruptedException interrupt) {
            try {
              signalConditionsOfSatisfiedGuards(guard);
            } catch (Throwable throwable) {
              Thread.currentThread().interrupt();
View Full Code Here

          if (queuePosition == -1) {
            if (state == State.STOPPED) {
              unusedConditions.add(myCondition);
              return null;
            }
            myCondition.await();
            continue waitLoop;
          }
          BatchInfo myBatch = batches.get(queuePosition);
          long waitDelay = myBatch.waitDelay();
          if (state != State.STOPPED && waitDelay > 0) {
View Full Code Here

            continue waitLoop;
          }
          BatchInfo myBatch = batches.get(queuePosition);
          long waitDelay = myBatch.waitDelay();
          if (state != State.STOPPED && waitDelay > 0) {
            myCondition.await(waitDelay, TimeUnit.MILLISECONDS);
          } else {
            --numThreads;
            List<BatchCommand<?,?>> commands = myBatch
                .removeCommands(state == State.STOPPING);
            batches.remove(queuePosition);
View Full Code Here

               
                if (condition != null)
                {
                    try
                    {
                        condition.await(lockstep, TimeUnit.MILLISECONDS) ;
                    }
                    catch (final InterruptedException ie)
                    {
                        LOGGER.warn("Waiting delivery thread interupted while waiting on message pickup on InVM queue '" + serviceId + "'.  Exiting pickup wait state.") ;
                    }
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.