Examples of countDown()


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

        // completing parsing the media file
        //
        pipe.getBus().connect(new Bus.ASYNC_DONE() {
            public void asyncDone(GstObject source) {
                pipe.stop();
                done.countDown();
            }
        });
        audio.set("signal-handoffs", true);
        video.set("signal-handoffs", true);
       
View Full Code Here

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

        // As soon as data starts to flow, it means all tags have been found
        //
        BaseSink.HANDOFF handoff = new BaseSink.HANDOFF() {
            public void handoff(BaseSink sink, Buffer buffer, Pad pad) {
                pipe.stop();
                done.countDown();
            }
        };
        audio.connect(handoff);
        video.connect(handoff);
       
View Full Code Here

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

             + ((double)PERFORMANCE_TEST_DATA_PAYLOAD.length / 1024) + "Kb"
             + " Session is " + TRANS_DESC[transacted] + " transacted");
      long startTime = System.currentTimeMillis();
      sendThread.start();
      subscriber.setMessageListener(listener);
      startFlag.countDown();
      synchronized (listener)
      {
         topicConnection.start();
         listener.wait();
      }
View Full Code Here

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

                  TopicSession session = topicConnection.createTopicSession(transacted != TRANS_NONE, Session.AUTO_ACKNOWLEDGE);
                  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);
View Full Code Here

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

                  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++)
                  {
View Full Code Here

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

    ViewFactory viewFactory = new SwingViewFactory();
    // 1. Create a very simple short task that simply counts down latch
    final CountDownLatch shortTaskLatch = new CountDownLatch(1);
    Callable<Void> shortTask = new Callable<Void>() {
        public Void call() throws Exception {
          shortTaskLatch.countDown();
          return null;
        }
      };
    // Create an exception handler that fails test if it was called
    ThreadedTaskController.ExceptionHandler noExceptionHandler =
View Full Code Here

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

    // 2. Create a longer task
    final CountDownLatch longTaskLatch = new CountDownLatch(2);
    Callable<Void> longTask = new Callable<Void>() {
        public Void call() throws Exception {
          Thread.sleep(1000);
          longTaskLatch.countDown();
          return null;
        }
      };
    // Add a listener that counts down latch once a waiting dialog is displayed
    activeWindowListener = new PropertyChangeListener() {
View Full Code Here

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

        }
      };
    // Add a listener that counts down latch once a waiting dialog is displayed
    activeWindowListener = new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent ev) {
            longTaskLatch.countDown();
          }
        };
    KeyboardFocusManager.getCurrentKeyboardFocusManager().
        addPropertyChangeListener("activeWindow", activeWindowListener);
    // Check that a long task creates a visible dialog at screen
View Full Code Here

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

    Callable<Void> cancelledTask = new Callable<Void>() {
        public Void call() throws Exception {
          try {
            Thread.sleep(1000);
          } catch (InterruptedException ex) {
            cancelledTaskLatch.countDown();
          }
          return null;
        }
      };
    // Add a listener that closes the waiting dialog
View Full Code Here

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

    // 4. Create a task that fails 
    final CountDownLatch failingTaskLatch = new CountDownLatch(2);
    Callable<Void> failingTask = new Callable<Void>() {
        public Void call() throws Exception {
          failingTaskLatch.countDown();
          throw new Exception();
        }
      };
    // Create an exception handler that counts down latch when it's called
    ThreadedTaskController.ExceptionHandler exceptionHandler =
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.