Package java.util.concurrent

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


      {
         readerDone.countDown();
      }

      // wait for the writer to finish
      writerDone.await();

      assertNull("Node was removed", cache.getNode(FQN));

      // If any assertion failed, throw on the AssertionFailedError
View Full Code Here


      }, "SECOND");
      secondThread.start();

      // wait for both threads to finish
      secondDone.await();
      firstDone.await();

      // If any assertion failed, throw on the AssertionFailedError
      if (readerError != null)
      {
         throw readerError;
View Full Code Here

      {
         public void run()
         {
            try
            {
               latch.await();
               for (int i = 0; i < loops; i++)
               {
                  loader.remove(singleFqn ? fqn : fqns.get(r.nextInt(fqns.size())));
               }
            }
View Full Code Here

      {
         public void run()
         {
            try
            {
               latch.await();
               for (int i = 0; i < loops; i++)
               {
                  loader.remove(singleFqn ? fqn : fqns.get(r.nextInt(fqns.size())), "k");
               }
            }
View Full Code Here

      {
         public void run()
         {
            try
            {
               latch.await();
               for (int i = 0; i < loops; i++)
               {
                  loader.get(singleFqn ? fqn : fqns.get(r.nextInt(fqns.size())));
               }
            }
View Full Code Here

      {
         public void run()
         {
            try
            {
               latch.await();
               for (int i = 0; i < loops; i++)
               {
                  loader.getChildrenNames(singleFqn ? fqn : fqns.get(r.nextInt(fqns.size())));
               }
            }
View Full Code Here

      {
         public void run()
         {
            try
            {
               latch.await();
               for (int i = 0; i < loops; i++)
               {
                  loader.put(singleFqn ? fqn : fqns.get(r.nextInt(fqns.size())), "k", "v");
               }
            }
View Full Code Here

      {
         public void run()
         {
            try
            {
               latch.await();
               for (int i = 0; i < loops; i++)
               {
                  loader.put(singleFqn ? fqn : fqns.get(r.nextInt(fqns.size())), new HashMap<Object, Object>());
               }
            }
View Full Code Here

      {
         readerDone.countDown();
      }

      // wait for the writer to finish
      writerDone.await();

      assertNull("Node was not removed", cache.getNode(FQN));

      // If any assertion failed, throw on the AssertionFailedError
View Full Code Here

         AbstractListener syncListener = new Listener(latch);
         AbstractListener asyncListener = new AsyncListener(latch);
         c.addCacheListener(syncListener);
         c.addCacheListener(asyncListener);
         c.put("/a", "k", "v");
         latch.await();
         assert syncListener.caller == Thread.currentThread();
         assert asyncListener.caller != Thread.currentThread();
      }
      finally
      {
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.