ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/LinkedTransferQueueTest.java
(Generate patch)

Comparing jsr166/src/test/tck/LinkedTransferQueueTest.java (file contents):
Revision 1.39 by jsr166, Fri Nov 5 00:17:22 2010 UTC vs.
Revision 1.40 by jsr166, Thu Nov 18 18:37:55 2010 UTC

# Line 1072 | Line 1072 | public class LinkedTransferQueueTest ext
1072      }
1073  
1074      /**
1075 <     * tryTransfer waits the amount given if interrupted, and
1076 <     * throws interrupted exception
1075 >     * tryTransfer waits the amount given, and throws
1076 >     * InterruptedException when interrupted.
1077       */
1078      public void testTryTransfer5() throws InterruptedException {
1079          final LinkedTransferQueue q = new LinkedTransferQueue();
1080          final CountDownLatch threadStarted = new CountDownLatch(1);
1081 +        assertTrue(q.isEmpty());
1082  
1083          Thread t = newStartedThread(new CheckedRunnable() {
1084              public void realRun() throws InterruptedException {
# Line 1088 | Line 1089 | public class LinkedTransferQueueTest ext
1089                      shouldThrow();
1090                  } catch (InterruptedException success) {}
1091                  assertTrue(millisElapsedSince(t0) >= SHORT_DELAY_MS);
1092 +                assertTrue(millisElapsedSince(t0) < MEDIUM_DELAY_MS);
1093              }});
1094  
1095          threadStarted.await();
1096 +        while (q.isEmpty())
1097 +            Thread.yield();
1098          Thread.sleep(SHORT_DELAY_MS);
1099          t.interrupt();
1100          awaitTermination(t, MEDIUM_DELAY_MS);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines