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(), |
358 |
|
shuffle(interruptibleLockBlockingActions); |
359 |
|
|
360 |
|
assertThrowInterruptedExceptionWhenInterrupted(interruptibleLockBlockingActions); |
361 |
+ |
|
362 |
+ |
releaseWriteLock(lock, stamp); |
363 |
|
} |
364 |
|
|
365 |
|
/** |
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(), |
378 |
|
shuffle(interruptibleLockBlockingActions); |
379 |
|
|
380 |
|
assertThrowInterruptedExceptionWhenInterrupted(interruptibleLockBlockingActions); |
381 |
+ |
|
382 |
+ |
releaseReadLock(lock, stamp); |
383 |
|
} |
384 |
|
|
385 |
|
/** |