Package java.util.concurrent

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


        public void run() {
          try {
            mapper.map(new TestObject(), TestObjectPrime.class);
          }
          finally {
            latch.countDown();
          }
        }
      }).start();

    }
View Full Code Here


              request.setExecutionInteraction( executionInteraction );
           }
           public void aboutToExecuteRequest( Request request ) { }

           public void requestExecutionComplete( Request request, int result, String output ) {
               complete.countDown();
           }
        };

        gradlePluginLord.addRequestObserver( observer, false );   //add the observer before we add the request due to timing issues. It's possible for it to completely execute before we return from addRefreshRequestToQueue.
        Request request = gradlePluginLord.addRefreshRequestToQueue();
View Full Code Here

            @Override
            public void handleHttpRequest(HttpRequest request, HttpResponse response, HttpControl control) throws Exception {
                System.out.println("We got here");
                server.stop().join();
                System.out.println("But never here");
                stopper.countDown();
            }
        });
        Socket client = new Socket(InetAddress.getLocalHost(), 9080);
        OutputStream http = client.getOutputStream();
        http.write(("" +
View Full Code Here

      public void run() {
        assertTrue(sharedCon != null);

        try {
          latch.countDown();
          latch.await();
          sharedCon.addStatement(painter, RDF.TYPE, RDFS.CLASS);

          // wait a bit to allow other thread to add stuff as well.
          Thread.sleep(500L);
View Full Code Here

    // execute the other thread
    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

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

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

             + ((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

                  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

                  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

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.