--- jsr166/src/test/tck/LinkedTransferQueueTest.java 2010/11/05 00:17:22 1.39 +++ jsr166/src/test/tck/LinkedTransferQueueTest.java 2010/11/18 18:37:55 1.40 @@ -1072,12 +1072,13 @@ public class LinkedTransferQueueTest ext } /** - * tryTransfer waits the amount given if interrupted, and - * throws interrupted exception + * tryTransfer waits the amount given, and throws + * InterruptedException when interrupted. */ public void testTryTransfer5() throws InterruptedException { final LinkedTransferQueue q = new LinkedTransferQueue(); final CountDownLatch threadStarted = new CountDownLatch(1); + assertTrue(q.isEmpty()); Thread t = newStartedThread(new CheckedRunnable() { public void realRun() throws InterruptedException { @@ -1088,9 +1089,12 @@ public class LinkedTransferQueueTest ext shouldThrow(); } catch (InterruptedException success) {} assertTrue(millisElapsedSince(t0) >= SHORT_DELAY_MS); + assertTrue(millisElapsedSince(t0) < MEDIUM_DELAY_MS); }}); threadStarted.await(); + while (q.isEmpty()) + Thread.yield(); Thread.sleep(SHORT_DELAY_MS); t.interrupt(); awaitTermination(t, MEDIUM_DELAY_MS);