--- jsr166/src/test/tck/JSR166TestCase.java 2017/05/13 21:43:50 1.224 +++ jsr166/src/test/tck/JSR166TestCase.java 2017/05/14 00:37:42 1.226 @@ -1068,7 +1068,7 @@ public class JSR166TestCase extends Test void assertThreadBlocks(Thread thread, Thread.State expected) { // always sleep at least 1 ms, avoiding transitional states // with high probability - for (long retries = LONG_DELAY_MS; retries-->0; ) { + for (long retries = LONG_DELAY_MS * 3 / 4; retries-->0; ) { try { delay(1); } catch (InterruptedException fail) { fail("Unexpected InterruptedException"); @@ -1635,6 +1635,14 @@ public class JSR166TestCase extends Test } catch (Throwable fail) { threadUnexpectedException(fail); } + } + + public void await(CyclicBarrier barrier) { + try { + barrier.await(LONG_DELAY_MS, MILLISECONDS); + } catch (Throwable fail) { + threadUnexpectedException(fail); + } } // /**