Examples of countDown()


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

               writerFailed = true;
            }
            finally
            {
               readerCanRead.countDown();
               writerDone.countDown();
            }
         }
      }, "WRITER");
      writerThread.start();
View Full Code Here

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

               CacheSPI cache = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(config, getClass());
               cacheServer.setCache(cache);
               cacheServer.create();
               cacheServer.start();
               START_COUNT++;
               startedSignal.countDown();
            }
            catch (Exception ex)
            {
               ex.printStackTrace();
            }
View Full Code Here

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

            adders[i]=new Adder(win, latch, counter, seqno, removed_msgs);
            adders[i].start();
        }

        long start=System.currentTimeMillis();
        latch.countDown(); // starts all adders

        for(Adder adder: adders) {
            try {
                adder.join();
            }
View Full Code Here

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

            final int x = i;
            tasks[i] = new Task() {
                public void call() throws Exception {
                    for (int a = 0; a < count; a++) {
                        connList[x].createStatement().execute("update test set value=value+1");
                        latch.countDown();
                        latch.await();
                    }
                }
            };
            tasks[i].execute();
View Full Code Here

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

    HashSet<Callable<Object>> callables = new HashSet<Callable<Object>>();

    for (int i = 0; i < THREAD_COUNT; i++) {
      callables.add(new Callable<Object>() {
        public Object call() throws Exception {
          latch.countDown();
          latch.await();
          Mapper processor = mapper.getMappingProcessor();
          assertNotNull(processor);
          return null;
        }
View Full Code Here

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

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

              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

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

            @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

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

      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

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

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