Package org.hornetq.utils

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


   {
      ReusableLatch latch = new ReusableLatch();

      for (int i = 1; i <= 100; i++)
      {
         latch.countUp();
         Assert.assertEquals(i, latch.getCount());
      }

      for (int i = 100; i > 0; i--)
      {
View Full Code Here


    */
   public void testLatchOnMultiThread() throws Exception
   {
      final ReusableLatch latch = new ReusableLatch();

      latch.countUp(); // We hold at least one, so ThreadWaits won't go away

      final int numberOfThreads = 100;
      final int numberOfAdds = 100;

      class ThreadWait extends Thread
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.countUp();
               }
            }
            catch (Exception e)
            {
               ReusableLatchTest.log.error(e.getMessage(), e);
View Full Code Here

      for (int i = 0 ; i < 5; i++)
      {
         latch.countDown();
      }
     
      latch.countUp();

      class ThreadWait extends Thread
      {
         private volatile boolean waiting = false;
View Full Code Here

      Assert.assertEquals(false, t.waiting);

      Assert.assertNull(t.e);

      latch.countUp();

      t = new ThreadWait();
      t.start();

      t.readyLatch.await();
View Full Code Here

      setup(2, 60 * 1024, false);

      SimpleIDGenerator idGen = new SimpleIDGenerator(1000);

      final ReusableLatch reusableLatchDone = new ReusableLatch();
      reusableLatchDone.countUp();
      final ReusableLatch reusableLatchWait = new ReusableLatch();
      reusableLatchWait.countUp();

      journal = new JournalImpl(fileSize, minFiles, 0, 0, fileFactory, filePrefix, fileExtension, maxAIO)
      {
View Full Code Here

      SimpleIDGenerator idGen = new SimpleIDGenerator(1000);

      final ReusableLatch reusableLatchDone = new ReusableLatch();
      reusableLatchDone.countUp();
      final ReusableLatch reusableLatchWait = new ReusableLatch();
      reusableLatchWait.countUp();

      journal = new JournalImpl(fileSize, minFiles, 0, 0, fileFactory, filePrefix, fileExtension, maxAIO)
      {

         @Override
View Full Code Here

   {

      setup(2, 60 * 1024, false);

      final ReusableLatch reusableLatchDone = new ReusableLatch();
      reusableLatchDone.countUp();
      final ReusableLatch reusableLatchWait = new ReusableLatch();
      reusableLatchWait.countUp();

      journal = new JournalImpl(fileSize, minFiles, 0, 0, fileFactory, filePrefix, fileExtension, maxAIO)
      {
View Full Code Here

      setup(2, 60 * 1024, false);

      final ReusableLatch reusableLatchDone = new ReusableLatch();
      reusableLatchDone.countUp();
      final ReusableLatch reusableLatchWait = new ReusableLatch();
      reusableLatchWait.countUp();

      journal = new JournalImpl(fileSize, minFiles, 0, 0, fileFactory, filePrefix, fileExtension, maxAIO)
      {

         @Override
View Full Code Here

      setup(2, 60 * 1024, false);

      SimpleIDGenerator idGen = new SimpleIDGenerator(1000);

      final ReusableLatch reusableLatchDone = new ReusableLatch();
      reusableLatchDone.countUp();
      final ReusableLatch reusableLatchWait = new ReusableLatch();
      reusableLatchWait.countUp();

      journal = new JournalImpl(fileSize, minFiles, 0, 0, fileFactory, filePrefix, fileExtension, maxAIO)
      {
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.