--- jsr166/src/test/tck/JSR166TestCase.java 2016/02/22 19:36:59 1.185 +++ jsr166/src/test/tck/JSR166TestCase.java 2016/02/22 23:16:06 1.188 @@ -202,7 +202,7 @@ public class JSR166TestCase extends Test */ private static final float delayFactor = systemPropertyValue("jsr166.delay.factor", 1.0f); - + /** * The timeout factor as used in the jtreg test harness. * See: http://openjdk.java.net/jtreg/tag-spec.html @@ -585,7 +585,7 @@ public class JSR166TestCase extends Test /** * Returns the shortest timed delay. This can be scaled up for * slow machines using the jsr166.delay.factor system property, - * or via jtreg's -timeoutFactor: flag. + * or via jtreg's -timeoutFactor: flag. * http://openjdk.java.net/jtreg/command-help.html */ protected long getShortDelay() { @@ -1466,16 +1466,20 @@ public class JSR166TestCase extends Test return new LatchAwaiter(latch); } - public void await(CountDownLatch latch) { + public void await(CountDownLatch latch, long timeoutMillis) { try { - if (!latch.await(LONG_DELAY_MS, MILLISECONDS)) + if (!latch.await(timeoutMillis, MILLISECONDS)) fail("timed out waiting for CountDownLatch for " - + (LONG_DELAY_MS/1000) + " sec"); + + (timeoutMillis/1000) + " sec"); } catch (Throwable fail) { threadUnexpectedException(fail); } } + public void await(CountDownLatch latch) { + await(latch, LONG_DELAY_MS); + } + public void await(Semaphore semaphore) { try { if (!semaphore.tryAcquire(LONG_DELAY_MS, MILLISECONDS))