AsyncReadWriteLock, AsyncStampedLockpublic class FairAsyncStampedLock extends FairAsyncReadWriteLock implements AsyncStampedLock
AsyncStampedLock implementation which provides fair ordering of acquisitions, like
that of FairAsyncReadWriteLock. The tryOptimisticRead() method also employs fair
ordering, in that a stamp will not be issued if there are queued writers waiting to acquire the
lock. Validation of an already issued stamp, however, does not abide by
this ordering; it will only fail validation once a writer has successfully acquired the lock
(irrespective of queued writers)AsyncReadWriteLock.ReadLockToken, AsyncReadWriteLock.WriteLockTokenAsyncStampedLock.Stamp| Constructor | Description |
|---|---|
FairAsyncStampedLock() |
| Modifier and Type | Method | Description |
|---|---|---|
AsyncStampedLock.Stamp |
tryOptimisticRead() |
Attempts to acquire a
AsyncStampedLock.Stamp in optimistic-read mode if the lock is not already
write-locked. |
acquireReadLock, acquireWriteLock, tryReadLock, tryWriteLockcreate, createFairacquireReadLock, acquireWriteLock, tryReadLock, tryWriteLockpublic AsyncStampedLock.Stamp tryOptimisticRead()
AsyncStampedLockAsyncStampedLock.Stamp in optimistic-read mode if the lock is not already
write-locked. The stamp may subsequently be validated to check whether
the write lock has been acquiredtryOptimisticRead in interface AsyncStampedLock
nullCopyright © 2018. All rights reserved.