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

Comparing jsr166/src/test/tck/LockSupportTest.java (file contents):
Revision 1.26 by jsr166, Mon Oct 12 20:12:50 2015 UTC vs.
Revision 1.27 by jsr166, Fri May 12 18:12:52 2017 UTC

# Line 256 | Line 256 | public class LockSupportTest extends JSR
256      public void testParkTimesOut(final ParkMethod parkMethod) {
257          Thread t = newStartedThread(new CheckedRunnable() {
258              public void realRun() {
259 <                for (;;) {
259 >                for (int tries = MAX_SPURIOUS_WAKEUPS; tries-->0; ) {
260                      long startTime = System.nanoTime();
261                      parkMethod.park(timeoutMillis());
262                      // park may return spuriously
263                      if (millisElapsedSince(startTime) >= timeoutMillis())
264                          return;
265                  }
266 +                fail("too many consecutive spurious wakeups?");
267              }});
268  
269          awaitTermination(t);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines