Package java.util.concurrent

Examples of java.util.concurrent.CountDownLatch.await()


    Thread newThread = new Thread(runnable, "B (parallel)");
    newThread.start();

    try {
      latch.countDown();
      latch.await();
      con.addStatement(picasso, RDF.TYPE, painter);
      // let this thread sleep to enable other thread to finish its business.
      Thread.sleep(1000L);
      con.close();
    }
View Full Code Here


     */
    public static void main() {
        try {
            CountDownLatch latch = quit;
            if (latch != null) {
                latch.await();
            }
        } catch (InterruptedException ex) {
        } finally {
            quit = new CountDownLatch(1);
        }
View Full Code Here

        video.connect(handoff);
       
        // Start the pipeline playing
        pipe.pause();
        try {
            done.await();
        } catch (InterruptedException ex) {
        }
        pipe.stop();
    }
}
View Full Code Here

      DeploymentTask appclientTask = new DeploymentTask(startLatch, finishLatch, appClient);
      executor.execute(appclientTask);
     
      startLatch.countDown();
     
      assertTrue(finishLatch.await(5, TimeUnit.SECONDS));
     
      assertNull(warTask.exception);
      assertNull(jarTask.exception);
      assertNull(appclientTask.exception);
     
View Full Code Here

      testee.setBootstrapPort(9999);
     
      Thread t = new Thread(locker);
      t.setDaemon(true);
      t.start();
      assertTrue("FileLocker locked file", lockedLatch.await(10, TimeUnit.SECONDS));
      testee.start();
      testee.stop();
   }
  
   /** Hacky attempt to "lock" a file. */
 
View Full Code Here

                  TopicSession session = topicConnection.createTopicSession(transacted != TRANS_NONE, Session.AUTO_ACKNOWLEDGE);
                  Topic topic = (Topic)context.lookup(TEST_TOPIC);

                  TopicPublisher publisher = session.createPublisher(topic);

                  startFlag.await();

                  BytesMessage message = session.createBytesMessage();
                  message.writeBytes(PERFORMANCE_TEST_DATA_PAYLOAD);

                  long startTime = System.currentTimeMillis();
View Full Code Here

                  Topic topic = (Topic)context.lookup(TEST_TOPIC);

                  TopicPublisher publisher = session.createPublisher(topic);

                  alignFlag.countDown();
                  alignFlag.await();

                  BytesMessage message = session.createBytesMessage();
                  message.writeBytes(PERFORMANCE_TEST_DATA_PAYLOAD);

                  long startTime = System.currentTimeMillis();
View Full Code Here

                  TopicSession session = topicConnection.createTopicSession(transacted != TRANS_NONE, Session.AUTO_ACKNOWLEDGE);
                  Topic topic = (Topic)context.lookup(TEST_TOPIC);
                  TopicSubscriber subscriber = session.createSubscriber(topic);

                  alignFlag.countDown();
                  alignFlag.await();

                  long startTime = System.currentTimeMillis();
                  for (int i = 0; i < iterationCount; i++)
                  {
                     subscriber.receive();
View Full Code Here

    CountDownLatch countDown = new CountDownLatch(2);
    ArrayList<Style> styles = new ArrayList<Style>();
    new Thread(new Parser(countDown, parser, styles)).start();
    new Thread(new Marshaller(countDown, mctx, sld)).start();
    countDown.await();

    Assert.assertEquals("GEOSYM", styles.get(0).getName());
  }

  public class Marshaller implements Runnable {
View Full Code Here

         else
         {
            executor.executeBlocking(wrapper, startTimeout, TimeUnit.MILLISECONDS);
         }

         completedLatch.await();
      }
      catch (ExecutionTimedOutException etoe)
      {
         exception = new WorkRejectedException(etoe);
         exception.setErrorCode(WorkRejectedException.START_TIMED_OUT)
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.