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.44 by jsr166, Sun Sep 29 20:19:43 2019 UTC vs.
Revision 1.47 by dl, Tue Jan 26 13:33:06 2021 UTC

# Line 343 | Line 343 | public class StampedLockTest extends JSR
343       */
344      public void testInterruptibleOperationsThrowInterruptedExceptionWriteLockedInterrupted() {
345          final StampedLock lock = new StampedLock();
346 <        long s = lock.writeLock();
346 >        long stamp = lock.writeLock();
347  
348          Action[] interruptibleLockBlockingActions = {
349              () -> lock.writeLockInterruptibly(),
# Line 358 | Line 358 | public class StampedLockTest extends JSR
358          shuffle(interruptibleLockBlockingActions);
359  
360          assertThrowInterruptedExceptionWhenInterrupted(interruptibleLockBlockingActions);
361 +
362 +        releaseWriteLock(lock, stamp);
363      }
364  
365      /**
# Line 365 | Line 367 | public class StampedLockTest extends JSR
367       */
368      public void testInterruptibleOperationsThrowInterruptedExceptionReadLockedInterrupted() {
369          final StampedLock lock = new StampedLock();
370 <        long s = lock.readLock();
370 >        long stamp = lock.readLock();
371  
372          Action[] interruptibleLockBlockingActions = {
373              () -> lock.writeLockInterruptibly(),
# Line 376 | Line 378 | public class StampedLockTest extends JSR
378          shuffle(interruptibleLockBlockingActions);
379  
380          assertThrowInterruptedExceptionWhenInterrupted(interruptibleLockBlockingActions);
381 +
382 +        releaseReadLock(lock, stamp);
383      }
384  
385      /**
# Line 699 | Line 703 | public class StampedLockTest extends JSR
703          lock.unlockWrite(s);
704          s = lock.readLock();
705          assertTrue(lock.toString().contains("Read-locks"));
706 +        releaseReadLock(lock, s);
707      }
708  
709      /**
# Line 1396 | Line 1401 | public class StampedLockTest extends JSR
1401          final long testDurationMillis = expensiveTests ? 1000 : 2;
1402          final int nTasks = ThreadLocalRandom.current().nextInt(1, 10);
1403          final AtomicBoolean done = new AtomicBoolean(false);
1404 <        final List<CompletableFuture> futures = new ArrayList<>();
1404 >        final List<CompletableFuture<?>> futures = new ArrayList<>();
1405          final List<Callable<Long>> stampedWriteLockers = List.of(
1406              () -> sl.writeLock(),
1407              () -> writeLockInterruptiblyUninterrupted(sl),

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines