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

Comparing jsr166/src/test/tck/ReentrantLockTest.java (file contents):
Revision 1.62 by jsr166, Fri Jul 3 01:25:15 2015 UTC vs.
Revision 1.63 by jsr166, Fri Jul 3 05:48:30 2015 UTC

# Line 565 | Line 565 | public class ReentrantLockTest extends J
565              final ReentrantLock lock = new ReentrantLock(fair);
566              final Condition c = lock.newCondition();
567              lock.lock();
568 <            long startTime = System.nanoTime();
569 <            assertFalse(c.awaitUntil(delayedDate(timeoutMillis())));
570 <            assertTrue(millisElapsedSince(startTime) >= timeoutMillis());
568 >            // We shouldn't assume that nanoTime and currentTimeMillis
569 >            // use the same time source, so don't use nanoTime here.
570 >            java.util.Date delayedDate = delayedDate(timeoutMillis());
571 >            assertFalse(c.awaitUntil(delayedDate));
572 >            assertTrue(new java.util.Date().getTime() >= delayedDate.getTime());
573              lock.unlock();
574          } catch (InterruptedException fail) { threadUnexpectedException(fail); }
575      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines