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.26 by jsr166, Tue Oct 19 00:41:14 2010 UTC vs.
Revision 1.27 by jsr166, Thu Oct 28 17:22:13 2010 UTC

# Line 18 | Line 18 | import java.util.List;
18   import java.util.NoSuchElementException;
19   import java.util.concurrent.*;
20   import static java.util.concurrent.TimeUnit.MILLISECONDS;
21 + import static java.util.concurrent.TimeUnit.NANOSECONDS;
22   import junit.framework.Test;
23   import junit.framework.TestSuite;
24  
# Line 1053 | Line 1054 | public class LinkedTransferQueueTest ext
1054  
1055          Thread t = newStartedThread(new CheckedRunnable() {
1056              public void realRun() throws InterruptedException {
1057 +                long t0 = System.nanoTime();
1058                  assertFalse(q.tryTransfer(new Object(),
1059                                            SHORT_DELAY_MS, MILLISECONDS));
1060 +                long elapsed = NANOSECONDS.toMillis(System.nanoTime() - t0);
1061 +                assertTrue(elapsed >= SHORT_DELAY_MS);
1062              }});
1063  
1060        Thread.sleep(SMALL_DELAY_MS);
1064          checkEmpty(q);
1065 <        t.join();
1065 >        awaitTermination(t, MEDIUM_DELAY_MS);
1066 >        checkEmpty(q);
1067      }
1068  
1069      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines