--- jsr166/src/test/tck/JSR166TestCase.java 2011/03/15 19:47:06 1.74 +++ jsr166/src/test/tck/JSR166TestCase.java 2011/05/03 06:08:49 1.75 @@ -631,6 +631,14 @@ public class JSR166TestCase extends Test } /** + * Waits up to LONG_DELAY_MS for the given thread to enter a wait + * state: BLOCKED, WAITING, or TIMED_WAITING. + */ + void waitForThreadToEnterWaitState(Thread thread) { + waitForThreadToEnterWaitState(thread, LONG_DELAY_MS); + } + + /** * Returns the number of milliseconds since time given by * startNanoTime, which must have been previously returned from a * call to {@link System.nanoTime()}. @@ -667,6 +675,15 @@ public class JSR166TestCase extends Test } } + /** + * Waits for LONG_DELAY_MS milliseconds for the thread to + * terminate (using {@link Thread#join(long)}), else interrupts + * the thread (in the hope that it may terminate later) and fails. + */ + void awaitTermination(Thread t) { + awaitTermination(t, LONG_DELAY_MS); + } + // Some convenient Runnable classes public abstract class CheckedRunnable implements Runnable {