public interface AtomicLock extends SyncPrimitive
DEFAULT_OPERATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
AsyncAtomicLock |
async()
Returns the underlying asynchronous primitive.
|
Version |
lock()
Acquires the lock, blocking until it's available.
|
Optional<Version> |
tryLock()
Attempts to acquire the lock.
|
Optional<Version> |
tryLock(Duration timeout)
Attempts to acquire the lock for a specified amount of time.
|
void |
unlock()
Unlocks the lock.
|
close, deleteaddStateChangeListener, name, protocol, removeStateChangeListener, typeVersion lock()
Optional<Version> tryLock()
Optional<Version> tryLock(Duration timeout)
timeout - the timeout after which to give up attempting to acquire the lockvoid unlock()
AsyncAtomicLock async()
SyncPrimitiveasync in interface SyncPrimitiveCopyright © 2013–2018. All rights reserved.