Package org.hornetq.utils

Examples of org.hornetq.utils.ReusableLatch.countDown()


      }

      for (int i = 100; i > 0; i--)
      {
         Assert.assertEquals(i, latch.getCount());
         latch.countDown();
         Assert.assertEquals(i - 1, latch.getCount());
      }

      latch.await();
   }
View Full Code Here


               // Everybody should start at the same time, to worse concurrency
               // effects
               latchStart.await();
               for (int i = 0; i < numberOfAdds; i++)
               {
                  latch.countDown();
               }
            }
            catch (Exception e)
            {
               ReusableLatchTest.log.error(e.getMessage(), e);
View Full Code Here

      for (int i = 0; i < numberOfThreads; i++)
      {
         Assert.assertTrue(waits[i].waiting);
      }

      latch.countDown();

      for (int i = 0; i < numberOfThreads; i++)
      {
         waits[i].join();
      }
View Full Code Here

   public void testReuseLatch() throws Exception
   {
      final ReusableLatch latch = new ReusableLatch(5);
      for (int i = 0 ; i < 5; i++)
      {
         latch.countDown();
      }
     
      latch.countUp();

      class ThreadWait extends Thread
View Full Code Here

      t.readyLatch.await();

      Assert.assertEquals(true, t.waiting);

      latch.countDown();

      t.join();

      Assert.assertEquals(false, t.waiting);
View Full Code Here

      t.readyLatch.await();

      Assert.assertEquals(true, t.waiting);

      latch.countDown();

      t.join();

      Assert.assertEquals(false, t.waiting);
View Full Code Here

      Assert.assertTrue(latch.await(1000));

      Assert.assertEquals(0, latch.getCount());

      latch.countDown();

      Assert.assertEquals(0, latch.getCount());

   }
View Full Code Here

      commit(consumerTX);

      delete(addedRecord);

      reusableLatchWait.countDown();

      tCompact.join();

      journal.forceMoveNextFile();
View Full Code Here

      for (int i = 1; i < 5; i++)
      {
         delete(i);
      }

      reusableLatchWait.countDown();

      tCompact.join();

      // Delete part of the live records after cleanup is done
      for (int i = 5; i < 10; i++)
View Full Code Here

      updateTx(updateTX, appendTwo);

      commit(updateTX);
      // delete(appendTwo);

      reusableLatchWait.countDown();
      tCompact.join();

      journal.compact();

      stopJournal();
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.