public class ReentrantReadWriteLockTest extends JSR166TestCase
JSR166TestCase.AdjustablePolicy, JSR166TestCase.CallableOne, JSR166TestCase.CheckedBarrier, JSR166TestCase.CheckedCallable<T>, JSR166TestCase.CheckedInterruptedCallable<T>, JSR166TestCase.CheckedInterruptedRunnable, JSR166TestCase.CheckedRecursiveAction, JSR166TestCase.CheckedRecursiveTask<T>, JSR166TestCase.CheckedRunnable, JSR166TestCase.LongPossiblyInterruptedRunnable, JSR166TestCase.MediumInterruptedRunnable, JSR166TestCase.MediumPossiblyInterruptedRunnable, JSR166TestCase.MediumRunnable, JSR166TestCase.NoOpCallable, JSR166TestCase.NoOpREHandler, JSR166TestCase.NoOpRunnable, JSR166TestCase.NPETask, JSR166TestCase.RunnableShouldThrow, JSR166TestCase.ShortInterruptedRunnable, JSR166TestCase.ShortRunnable, JSR166TestCase.SimpleThreadFactory, JSR166TestCase.SmallCallable, JSR166TestCase.SmallPossiblyInterruptedRunnable, JSR166TestCase.SmallRunnable, JSR166TestCase.StringTask, JSR166TestCase.ThreadShouldThrow, JSR166TestCase.TrackedCallable, JSR166TestCase.TrackedLongRunnable, JSR166TestCase.TrackedMediumRunnable, JSR166TestCase.TrackedNoOpRunnable, JSR166TestCase.TrackedRunnable, JSR166TestCase.TrackedShortRunnable, JSR166TestCase.TrackedSmallRunnable
eight, expensiveTests, five, four, JAVA_CLASS_VERSION, JAVA_SPECIFICATION_VERSION, LONG_DELAY_MS, m1, m10, m2, m3, m4, m5, m6, MEDIUM_DELAY_MS, nine, one, seven, SHORT_DELAY_MS, six, SIZE, SMALL_DELAY_MS, TEST_STRING, testImplementationDetails, three, two, zero
Constructor and Description |
---|
ReentrantReadWriteLockTest() |
Modifier and Type | Method and Description |
---|---|
void |
testAwait_fair() |
void |
testAwait_IMSE_fair() |
void |
testAwait_IMSE()
Calling await without holding lock throws IllegalMonitorStateException
|
void |
testAwait_IMSE(boolean fair) |
void |
testAwait_Timeout_fair() |
void |
testAwait_Timeout()
timed await without a signal times out
|
void |
testAwait_Timeout(boolean fair) |
void |
testAwait()
await returns when signalled
|
void |
testAwait(boolean fair) |
void |
testAwaitLockCount_fair() |
void |
testAwaitLockCount()
await after multiple reentrant locking preserves lock count
|
void |
testAwaitLockCount(boolean fair) |
void |
testAwaitNanos_Timeout_fair() |
void |
testAwaitNanos_Timeout()
awaitNanos without a signal times out
|
void |
testAwaitNanos_Timeout(boolean fair) |
void |
testAwaitUninterruptibly_fair() |
void |
testAwaitUninterruptibly()
awaitUninterruptibly is uninterruptible
|
void |
testAwaitUninterruptibly(boolean fair) |
void |
testAwaitUntil_Timeout_fair() |
void |
testAwaitUntil_Timeout()
awaitUntil without a signal times out
|
void |
testAwaitUntil_Timeout(boolean fair) |
void |
testConstructor()
Constructor sets given fairness, and is in unlocked state
|
void |
testGetHoldCount_fair() |
void |
testGetHoldCount()
writelock.getHoldCount returns number of recursive holds
|
void |
testGetHoldCount(boolean fair) |
void |
testGetQueuedThreads_fair() |
void |
testGetQueuedThreads()
getQueuedThreads includes waiting threads
|
void |
testGetQueuedThreads(boolean fair) |
void |
testGetQueueLength_fair() |
void |
testGetQueueLength()
getQueueLength reports number of waiting threads
|
void |
testGetQueueLength(boolean fair) |
void |
testGetReadHoldCount_fair() |
void |
testGetReadHoldCount()
getReadHoldCount returns number of recursive holds
|
void |
testGetReadHoldCount(boolean fair) |
void |
testGetWaitingThreads_fair() |
void |
testGetWaitingThreads()
getWaitingThreads returns only and all waiting threads
|
void |
testGetWaitingThreads(boolean fair) |
void |
testGetWaitingThreadsIAE_fair() |
void |
testGetWaitingThreadsIAE()
getWaitingThreads throws IllegalArgumentException if not owned
|
void |
testGetWaitingThreadsIAE(boolean fair) |
void |
testGetWaitingThreadsIMSE_fair() |
void |
testGetWaitingThreadsIMSE()
getWaitingThreads throws IllegalMonitorStateException if not locked
|
void |
testGetWaitingThreadsIMSE(boolean fair) |
void |
testGetWaitingThreadsNPE_fair() |
void |
testGetWaitingThreadsNPE()
getWaitingThreads throws NPE if null
|
void |
testGetWaitingThreadsNPE(boolean fair) |
void |
testGetWaitQueueLength_fair() |
void |
testGetWaitQueueLength()
getWaitQueueLength returns number of waiting threads
|
void |
testGetWaitQueueLength(boolean fair) |
void |
testGetWaitQueueLengthIAE_fair() |
void |
testGetWaitQueueLengthIAE()
getWaitQueueLength throws IllegalArgumentException if not owned
|
void |
testGetWaitQueueLengthIAE(boolean fair) |
void |
testGetWaitQueueLengthIMSE_fair() |
void |
testGetWaitQueueLengthIMSE()
getWaitQueueLength throws IllegalMonitorStateException if not locked
|
void |
testGetWaitQueueLengthIMSE(boolean fair) |
void |
testGetWaitQueueLengthNPE_fair() |
void |
testGetWaitQueueLengthNPE()
getWaitQueueLength throws NPE if null
|
void |
testGetWaitQueueLengthNPE(boolean fair) |
void |
testGetWriteHoldCount_fair() |
void |
testGetWriteHoldCount()
getWriteHoldCount returns number of recursive holds
|
void |
testGetWriteHoldCount(boolean fair) |
void |
testHasQueuedThread_fair() |
void |
testHasQueuedThread()
hasQueuedThread reports whether a thread is queued
|
void |
testHasQueuedThread(boolean fair) |
void |
testHasQueuedThreadNPE_fair() |
void |
testHasQueuedThreadNPE()
hasQueuedThread(null) throws NPE
|
void |
testHasQueuedThreadNPE(boolean fair) |
void |
testHasQueuedThreads_fair() |
void |
testHasQueuedThreads()
hasQueuedThreads reports whether there are waiting threads
|
void |
testHasQueuedThreads(boolean fair) |
void |
testHasWaiters_fair() |
void |
testHasWaiters()
hasWaiters returns true when a thread is waiting, else false
|
void |
testHasWaiters(boolean fair) |
void |
testHasWaitersIAE_fair() |
void |
testHasWaitersIAE()
hasWaiters throws IllegalArgumentException if not owned
|
void |
testHasWaitersIAE(boolean fair) |
void |
testHasWaitersIMSE_fair() |
void |
testHasWaitersIMSE()
hasWaiters throws IllegalMonitorStateException if not locked
|
void |
testHasWaitersIMSE(boolean fair) |
void |
testHasWaitersNPE_fair() |
void |
testHasWaitersNPE()
hasWaiters throws NPE if null
|
void |
testHasWaitersNPE(boolean fair) |
void |
testInterruptible_await_fair() |
void |
testInterruptible_await()
await/awaitNanos/awaitUntil is interruptible
|
void |
testInterruptible_awaitNanos_fair() |
void |
testInterruptible_awaitNanos() |
void |
testInterruptible_awaitTimed_fair() |
void |
testInterruptible_awaitTimed() |
void |
testInterruptible_awaitUntil_fair() |
void |
testInterruptible_awaitUntil() |
void |
testInterruptible(boolean fair,
jsr166.ReentrantReadWriteLockTest.AwaitMethod awaitMethod) |
void |
testLock_fair() |
void |
testLock()
write-locking and read-locking an unlocked lock succeed
|
void |
testLock(boolean fair) |
void |
testMultipleReadLocks_fair() |
void |
testMultipleReadLocks()
Multiple threads can hold a read lock when not write-locked
|
void |
testMultipleReadLocks(boolean fair) |
void |
testReadAfterWriteLock_fair() |
void |
testReadAfterWriteLock()
Readlocks succeed only after a writing thread unlocks
|
void |
testReadAfterWriteLock(boolean fair) |
void |
testReaderWriterReaderFairFifo()
A thread that tries to acquire a fair read lock (non-reentrantly)
will block if there is a waiting writer thread
|
void |
testReadHoldingWriteLock_fair() |
void |
testReadHoldingWriteLock()
Read trylock succeeds if write locked by current thread
|
void |
testReadHoldingWriteLock(boolean fair) |
void |
testReadHoldingWriteLock2_fair() |
void |
testReadHoldingWriteLock2()
Read lock succeeds if write locked by current thread even if
other threads are waiting for readlock
|
void |
testReadHoldingWriteLock2(boolean fair) |
void |
testReadHoldingWriteLock3_fair() |
void |
testReadHoldingWriteLock3()
Read lock succeeds if write locked by current thread even if
other threads are waiting for writelock
|
void |
testReadHoldingWriteLock3(boolean fair) |
void |
testReadLockInterruptibly_fair() |
void |
testReadLockInterruptibly_Interruptible_fair() |
void |
testReadLockInterruptibly_Interruptible()
read-lockInterruptibly is interruptible
|
void |
testReadLockInterruptibly_Interruptible(boolean fair) |
void |
testReadLockInterruptibly()
read lockInterruptibly succeeds if lock free else is interruptible
|
void |
testReadLockInterruptibly(boolean fair) |
void |
testReadLockToString_fair() |
void |
testReadLockToString()
readLock.toString indicates current lock state
|
void |
testReadLockToString(boolean fair) |
void |
testReadTryLock_Interruptible_fair() |
void |
testReadTryLock_Interruptible()
timed read-tryLock is interruptible
|
void |
testReadTryLock_Interruptible(boolean fair) |
void |
testReadTryLock_Timeout_fair() |
void |
testReadTryLock_Timeout()
read timed tryLock times out if write-locked
|
void |
testReadTryLock_Timeout(boolean fair) |
void |
testReadTryLockBarging_fair() |
void |
testReadTryLockBarging()
Read trylock succeeds (barging) even in the presence of waiting
readers and/or writers
|
void |
testReadTryLockBarging(boolean fair) |
void |
testReadTryLockWhenLocked_fair() |
void |
testReadTryLockWhenLocked()
read-tryLock fails if locked
|
void |
testReadTryLockWhenLocked(boolean fair) |
void |
testReadUnlock_IMSE_fair() |
void |
testReadUnlock_IMSE()
read-unlocking an unlocked lock throws IllegalMonitorStateException
|
void |
testReadUnlock_IMSE(boolean fair) |
void |
testSerialization_fair() |
void |
testSerialization()
A serialized lock deserializes as unlocked
|
void |
testSerialization(boolean fair) |
void |
testSignal_IMSE_fair() |
void |
testSignal_IMSE()
Calling signal without holding lock throws IllegalMonitorStateException
|
void |
testSignal_IMSE(boolean fair) |
void |
testSignalAll_await_fair() |
void |
testSignalAll_await()
signalAll wakes up all threads
|
void |
testSignalAll_awaitNanos_fair() |
void |
testSignalAll_awaitNanos() |
void |
testSignalAll_awaitTimed_fair() |
void |
testSignalAll_awaitTimed() |
void |
testSignalAll_awaitUntil_fair() |
void |
testSignalAll_awaitUntil() |
void |
testSignalAll_IMSE_fair() |
void |
testSignalAll_IMSE()
Calling signalAll without holding lock throws IllegalMonitorStateException
|
void |
testSignalAll_IMSE(boolean fair) |
void |
testSignalAll(boolean fair,
jsr166.ReentrantReadWriteLockTest.AwaitMethod awaitMethod) |
void |
testSignalWakesFifo_fair() |
void |
testSignalWakesFifo()
signal wakes up waiting threads in FIFO order
|
void |
testSignalWakesFifo(boolean fair) |
void |
testToString_fair() |
void |
testToString()
toString indicates current lock state
|
void |
testToString(boolean fair) |
void |
testTryLockWhenReadLocked_fair() |
void |
testTryLockWhenReadLocked()
Read tryLock succeeds if readlocked but not writelocked
|
void |
testTryLockWhenReadLocked(boolean fair) |
void |
testWriteAfterMultipleReadLocks_fair() |
void |
testWriteAfterMultipleReadLocks()
A writelock succeeds only after reading threads unlock
|
void |
testWriteAfterMultipleReadLocks(boolean fair) |
void |
testWriteAfterReadLock_fair() |
void |
testWriteAfterReadLock()
A writelock succeeds only after a reading thread unlocks
|
void |
testWriteAfterReadLock(boolean fair) |
void |
testWriteHoldingWriteLock4_fair() |
void |
testWriteHoldingWriteLock4()
Write lock succeeds if write locked by current thread even if
other threads are waiting for writelock
|
void |
testWriteHoldingWriteLock4(boolean fair) |
void |
testWriteLockInterruptibly_fair() |
void |
testWriteLockInterruptibly_Interruptible_fair() |
void |
testWriteLockInterruptibly_Interruptible()
write-lockInterruptibly is interruptible
|
void |
testWriteLockInterruptibly_Interruptible(boolean fair) |
void |
testWriteLockInterruptibly()
write lockInterruptibly succeeds if unlocked, else is interruptible
|
void |
testWriteLockInterruptibly(boolean fair) |
void |
testWriteLockToString_fair() |
void |
testWriteLockToString()
writeLock.toString indicates current lock state
|
void |
testWriteLockToString(boolean fair) |
void |
testWriteTryLock_fair() |
void |
testWriteTryLock_Interruptible_fair() |
void |
testWriteTryLock_Interruptible()
timed write-tryLock is interruptible
|
void |
testWriteTryLock_Interruptible(boolean fair) |
void |
testWriteTryLock_Timeout_fair() |
void |
testWriteTryLock_Timeout()
write timed tryLock times out if locked
|
void |
testWriteTryLock_Timeout(boolean fair) |
void |
testWriteTryLock()
write-tryLock on an unlocked lock succeeds
|
void |
testWriteTryLock(boolean fair) |
void |
testWriteTryLockWhenLocked_fair() |
void |
testWriteTryLockWhenLocked()
write-tryLock fails if locked
|
void |
testWriteTryLockWhenLocked(boolean fair) |
void |
testWriteTryLockWhenReadLocked_fair() |
void |
testWriteTryLockWhenReadLocked()
write tryLock fails when readlocked
|
void |
testWriteTryLockWhenReadLocked(boolean fair) |
void |
testWriteUnlock_IMSE_fair() |
void |
testWriteUnlock_IMSE()
write-unlocking an unlocked lock throws IllegalMonitorStateException
|
void |
testWriteUnlock_IMSE(boolean fair) |
addNamedTestClasses, assertIteratorExhausted, assertThrows, atLeastJava10, atLeastJava6, atLeastJava7, atLeastJava8, atLeastJava9, await, await, await, awaiter, countDowner, getShortDelay, jdk8ParameterizedTestSuite, latchAwaitingStringTask, newTestSuite, parameterizedTestSuite, permissivePolicy, possiblyInterruptedRunnable, runBare, runTest, runTestProfiled, runWithoutPermissions, runWithPermissions, runWithSecurityManagerWithPermissions, setDelays, setUp, shouldThrow, shouldThrow, tearDown, testMethodNames, threadAssertEquals, threadAssertEquals, threadAssertFalse, threadAssertNull, threadAssertSame, threadAssertTrue, threadFail, threadRecordFailure, threadShouldThrow, threadShouldThrow, threadUnexpectedException, trackedRunnable
public void testConstructor()
public void testLock()
public void testLock_fair()
public void testLock(boolean fair)
public void testGetWriteHoldCount()
public void testGetWriteHoldCount_fair()
public void testGetWriteHoldCount(boolean fair)
public void testGetHoldCount()
public void testGetHoldCount_fair()
public void testGetHoldCount(boolean fair)
public void testGetReadHoldCount()
public void testGetReadHoldCount_fair()
public void testGetReadHoldCount(boolean fair)
public void testWriteUnlock_IMSE()
public void testWriteUnlock_IMSE_fair()
public void testWriteUnlock_IMSE(boolean fair)
public void testReadUnlock_IMSE()
public void testReadUnlock_IMSE_fair()
public void testReadUnlock_IMSE(boolean fair)
public void testWriteLockInterruptibly_Interruptible()
public void testWriteLockInterruptibly_Interruptible_fair()
public void testWriteLockInterruptibly_Interruptible(boolean fair)
public void testWriteTryLock_Interruptible()
public void testWriteTryLock_Interruptible_fair()
public void testWriteTryLock_Interruptible(boolean fair)
public void testReadLockInterruptibly_Interruptible()
public void testReadLockInterruptibly_Interruptible_fair()
public void testReadLockInterruptibly_Interruptible(boolean fair)
public void testReadTryLock_Interruptible()
public void testReadTryLock_Interruptible_fair()
public void testReadTryLock_Interruptible(boolean fair)
public void testWriteTryLock()
public void testWriteTryLock_fair()
public void testWriteTryLock(boolean fair)
public void testWriteTryLockWhenLocked()
public void testWriteTryLockWhenLocked_fair()
public void testWriteTryLockWhenLocked(boolean fair)
public void testReadTryLockWhenLocked()
public void testReadTryLockWhenLocked_fair()
public void testReadTryLockWhenLocked(boolean fair)
public void testMultipleReadLocks()
public void testMultipleReadLocks_fair()
public void testMultipleReadLocks(boolean fair)
public void testWriteAfterReadLock()
public void testWriteAfterReadLock_fair()
public void testWriteAfterReadLock(boolean fair)
public void testWriteAfterMultipleReadLocks()
public void testWriteAfterMultipleReadLocks_fair()
public void testWriteAfterMultipleReadLocks(boolean fair)
public void testReaderWriterReaderFairFifo()
public void testReadAfterWriteLock()
public void testReadAfterWriteLock_fair()
public void testReadAfterWriteLock(boolean fair)
public void testReadHoldingWriteLock()
public void testReadHoldingWriteLock_fair()
public void testReadHoldingWriteLock(boolean fair)
public void testReadTryLockBarging()
public void testReadTryLockBarging_fair()
public void testReadTryLockBarging(boolean fair)
public void testReadHoldingWriteLock2()
public void testReadHoldingWriteLock2_fair()
public void testReadHoldingWriteLock2(boolean fair)
public void testReadHoldingWriteLock3()
public void testReadHoldingWriteLock3_fair()
public void testReadHoldingWriteLock3(boolean fair)
public void testWriteHoldingWriteLock4()
public void testWriteHoldingWriteLock4_fair()
public void testWriteHoldingWriteLock4(boolean fair)
public void testTryLockWhenReadLocked()
public void testTryLockWhenReadLocked_fair()
public void testTryLockWhenReadLocked(boolean fair)
public void testWriteTryLockWhenReadLocked()
public void testWriteTryLockWhenReadLocked_fair()
public void testWriteTryLockWhenReadLocked(boolean fair)
public void testWriteTryLock_Timeout()
public void testWriteTryLock_Timeout_fair()
public void testWriteTryLock_Timeout(boolean fair)
public void testReadTryLock_Timeout()
public void testReadTryLock_Timeout_fair()
public void testReadTryLock_Timeout(boolean fair)
public void testWriteLockInterruptibly()
public void testWriteLockInterruptibly_fair()
public void testWriteLockInterruptibly(boolean fair)
public void testReadLockInterruptibly()
public void testReadLockInterruptibly_fair()
public void testReadLockInterruptibly(boolean fair)
public void testAwait_IMSE()
public void testAwait_IMSE_fair()
public void testAwait_IMSE(boolean fair)
public void testSignal_IMSE()
public void testSignal_IMSE_fair()
public void testSignal_IMSE(boolean fair)
public void testSignalAll_IMSE()
public void testSignalAll_IMSE_fair()
public void testSignalAll_IMSE(boolean fair)
public void testAwaitNanos_Timeout()
public void testAwaitNanos_Timeout_fair()
public void testAwaitNanos_Timeout(boolean fair)
public void testAwait_Timeout()
public void testAwait_Timeout_fair()
public void testAwait_Timeout(boolean fair)
public void testAwaitUntil_Timeout()
public void testAwaitUntil_Timeout_fair()
public void testAwaitUntil_Timeout(boolean fair)
public void testAwait()
public void testAwait_fair()
public void testAwait(boolean fair)
public void testAwaitUninterruptibly()
public void testAwaitUninterruptibly_fair()
public void testAwaitUninterruptibly(boolean fair)
public void testInterruptible_await()
public void testInterruptible_await_fair()
public void testInterruptible_awaitTimed()
public void testInterruptible_awaitTimed_fair()
public void testInterruptible_awaitNanos()
public void testInterruptible_awaitNanos_fair()
public void testInterruptible_awaitUntil()
public void testInterruptible_awaitUntil_fair()
public void testInterruptible(boolean fair, jsr166.ReentrantReadWriteLockTest.AwaitMethod awaitMethod)
public void testSignalAll_await()
public void testSignalAll_await_fair()
public void testSignalAll_awaitTimed()
public void testSignalAll_awaitTimed_fair()
public void testSignalAll_awaitNanos()
public void testSignalAll_awaitNanos_fair()
public void testSignalAll_awaitUntil()
public void testSignalAll_awaitUntil_fair()
public void testSignalAll(boolean fair, jsr166.ReentrantReadWriteLockTest.AwaitMethod awaitMethod)
public void testSignalWakesFifo()
public void testSignalWakesFifo_fair()
public void testSignalWakesFifo(boolean fair)
public void testAwaitLockCount()
public void testAwaitLockCount_fair()
public void testAwaitLockCount(boolean fair)
public void testSerialization()
public void testSerialization_fair()
public void testSerialization(boolean fair)
public void testHasQueuedThreads()
public void testHasQueuedThreads_fair()
public void testHasQueuedThreads(boolean fair)
public void testHasQueuedThreadNPE()
public void testHasQueuedThreadNPE_fair()
public void testHasQueuedThreadNPE(boolean fair)
public void testHasQueuedThread()
public void testHasQueuedThread_fair()
public void testHasQueuedThread(boolean fair)
public void testGetQueueLength()
public void testGetQueueLength_fair()
public void testGetQueueLength(boolean fair)
public void testGetQueuedThreads()
public void testGetQueuedThreads_fair()
public void testGetQueuedThreads(boolean fair)
public void testHasWaitersNPE()
public void testHasWaitersNPE_fair()
public void testHasWaitersNPE(boolean fair)
public void testGetWaitQueueLengthNPE()
public void testGetWaitQueueLengthNPE_fair()
public void testGetWaitQueueLengthNPE(boolean fair)
public void testGetWaitingThreadsNPE()
public void testGetWaitingThreadsNPE_fair()
public void testGetWaitingThreadsNPE(boolean fair)
public void testHasWaitersIAE()
public void testHasWaitersIAE_fair()
public void testHasWaitersIAE(boolean fair)
public void testHasWaitersIMSE()
public void testHasWaitersIMSE_fair()
public void testHasWaitersIMSE(boolean fair)
public void testGetWaitQueueLengthIAE()
public void testGetWaitQueueLengthIAE_fair()
public void testGetWaitQueueLengthIAE(boolean fair)
public void testGetWaitQueueLengthIMSE()
public void testGetWaitQueueLengthIMSE_fair()
public void testGetWaitQueueLengthIMSE(boolean fair)
public void testGetWaitingThreadsIAE()
public void testGetWaitingThreadsIAE_fair()
public void testGetWaitingThreadsIAE(boolean fair)
public void testGetWaitingThreadsIMSE()
public void testGetWaitingThreadsIMSE_fair()
public void testGetWaitingThreadsIMSE(boolean fair)
public void testHasWaiters()
public void testHasWaiters_fair()
public void testHasWaiters(boolean fair)
public void testGetWaitQueueLength()
public void testGetWaitQueueLength_fair()
public void testGetWaitQueueLength(boolean fair)
public void testGetWaitingThreads()
public void testGetWaitingThreads_fair()
public void testGetWaitingThreads(boolean fair)
public void testToString()
public void testToString_fair()
public void testToString(boolean fair)
public void testReadLockToString()
public void testReadLockToString_fair()
public void testReadLockToString(boolean fair)
public void testWriteLockToString()
public void testWriteLockToString_fair()
public void testWriteLockToString(boolean fair)