--- jsr166/src/test/tck/JSR166TestCase.java 2017/05/13 22:36:45 1.225 +++ jsr166/src/test/tck/JSR166TestCase.java 2017/05/15 17:02:46 1.231 @@ -1066,8 +1066,8 @@ public class JSR166TestCase extends Test * Checks that thread eventually enters the expected blocked thread state. */ void assertThreadBlocks(Thread thread, Thread.State expected) { - // always sleep at least 1 ms, avoiding transitional states - // with high probability + // always sleep at least 1 ms, with high probability avoiding + // transitory states for (long retries = LONG_DELAY_MS * 3 / 4; retries-->0; ) { try { delay(1); } catch (InterruptedException fail) { @@ -1085,6 +1085,7 @@ public class JSR166TestCase extends Test /** * Checks that thread does not terminate within the default * millisecond delay of {@code timeoutMillis()}. + * TODO: REMOVEME */ void assertThreadStaysAlive(Thread thread) { assertThreadStaysAlive(thread, timeoutMillis()); @@ -1092,6 +1093,7 @@ public class JSR166TestCase extends Test /** * Checks that thread does not terminate within the given millisecond delay. + * TODO: REMOVEME */ void assertThreadStaysAlive(Thread thread, long millis) { try { @@ -1106,6 +1108,7 @@ public class JSR166TestCase extends Test /** * Checks that the threads do not terminate within the default * millisecond delay of {@code timeoutMillis()}. + * TODO: REMOVEME */ void assertThreadsStayAlive(Thread... threads) { assertThreadsStayAlive(timeoutMillis(), threads); @@ -1113,6 +1116,7 @@ public class JSR166TestCase extends Test /** * Checks that the threads do not terminate within the given millisecond delay. + * TODO: REMOVEME */ void assertThreadsStayAlive(long millis, Thread... threads) { try { @@ -1635,6 +1639,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); + } } // /**