public interface OptimisticLock
| Modifier and Type | Method and Description |
|---|---|
long |
readLock()
Aquire a lock token for reading
|
boolean |
readLockHeld(long lockToken)
check if optimistic locking succeeded
|
long |
tryWriteLock() |
long |
tryWriteLock(long time,
TimeUnit unit) |
long |
tryWriteLockInterruptibly() |
void |
unlock(long sequence)
"commit" or unlock the sequence when the write lock is held
|
long |
writeLock()
Acquire the lock for writing, waiting if needed
|
long readLock()
boolean readLockHeld(long lockToken)
lockToken - - the value returned from tryLocklong writeLock()
long tryWriteLockInterruptibly()
throws InterruptedException
InterruptedException - - on interruptlong tryWriteLock()
long tryWriteLock(long time,
TimeUnit unit)
throws InterruptedException
InterruptedException - on interruptvoid unlock(long sequence)
sequence - - lock sequence to unlockCopyright © 2012–2018 Conversant Engineering. All rights reserved.