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

Comparing jsr166/src/test/tck/StampedLockTest.java (file contents):
Revision 1.31 by jsr166, Sat Feb 18 00:34:52 2017 UTC vs.
Revision 1.32 by jsr166, Sat Feb 18 00:39:20 2017 UTC

# Line 735 | Line 735 | public class StampedLockTest extends JSR
735       */
736      public void testValidateOptimisticWriteLocked2()
737              throws InterruptedException {
738 <        final CountDownLatch running = new CountDownLatch(1);
738 >        final CountDownLatch locked = new CountDownLatch(1);
739          final StampedLock lock = new StampedLock();
740          final long p = assertValid(lock, lock.tryOptimisticRead());
741  
742          Thread t = newStartedThread(new CheckedInterruptedRunnable() {
743              public void realRun() throws InterruptedException {
744                  lock.writeLockInterruptibly();
745 <                running.countDown();
745 >                locked.countDown();
746                  lock.writeLockInterruptibly();
747              }});
748  
749 <        running.await();
749 >        locked.await();
750          assertFalse(lock.validate(p));
751          assertEquals(0L, lock.tryOptimisticRead());
752          t.interrupt();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines