예제 #1
0
 @Override
 public void run() {
   try {
     if (!latch.await(5000)) {
       UnitTestLogger.LOGGER.error("Latch timed out");
     }
   } catch (Exception e) {
     UnitTestLogger.LOGGER.error(e);
   }
   waiting = false;
 }
예제 #2
0
 @Override
 public void run() {
   waiting = true;
   readyLatch.countDown();
   try {
     if (!latch.await(1000)) {
       UnitTestLogger.LOGGER.error("Latch timed out!", new Exception("trace"));
     }
   } catch (Exception e) {
     UnitTestLogger.LOGGER.error(e);
     this.e = e;
   }
   waiting = false;
 }
예제 #3
0
 @Override
 public void run() {
   try {
     latchReady.countDown();
     // 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) {
     UnitTestLogger.LOGGER.error(e.getMessage(), e);
   }
 }