public interface RLockAsync extends RExpirableAsync
Lock
Modifier and Type | Method and Description |
---|---|
RFuture<Boolean> |
forceUnlockAsync()
Unlocks lock independently of state
|
RFuture<Integer> |
getHoldCountAsync()
Number of holds on this lock by the current thread
|
RFuture<Void> |
lockAsync() |
RFuture<Void> |
lockAsync(long threadId) |
RFuture<Void> |
lockAsync(long leaseTime,
TimeUnit unit)
Acquires the lock.
|
RFuture<Void> |
lockAsync(long leaseTime,
TimeUnit unit,
long threadId) |
RFuture<Boolean> |
tryLockAsync() |
RFuture<Boolean> |
tryLockAsync(long threadId) |
RFuture<Boolean> |
tryLockAsync(long waitTime,
long leaseTime,
TimeUnit unit) |
RFuture<Boolean> |
tryLockAsync(long waitTime,
long leaseTime,
TimeUnit unit,
long threadId) |
RFuture<Boolean> |
tryLockAsync(long waitTime,
TimeUnit unit) |
RFuture<Void> |
unlockAsync() |
RFuture<Void> |
unlockAsync(long threadId) |
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
copyAsync, deleteAsync, dumpAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
RFuture<Boolean> forceUnlockAsync()
true
if unlocked otherwise false
RFuture<Void> lockAsync(long leaseTime, TimeUnit unit)
If the lock is not available then the current thread becomes
disabled for thread scheduling purposes and lies dormant until the
lock has been acquired.
If the lock is acquired, it is held until unlock
is invoked,
or until leaseTime milliseconds have passed
since the lock was granted - whichever comes first.
leaseTime
- the maximum time to hold the lock after granting it,
before automatically releasing it if it hasn't already been released by invoking unlock
.
If leaseTime is -1, hold the lock until explicitly unlocked.unit
- the time unit of the leaseTime
argumentRFuture<Boolean> tryLockAsync(long waitTime, long leaseTime, TimeUnit unit, long threadId)
Copyright © 2014–2019 The Redisson Project. All rights reserved.