diff --git a/src/main/java/org/redisson/core/RLock.java b/src/main/java/org/redisson/core/RLock.java index 65b053949..c4a725ed8 100644 --- a/src/main/java/org/redisson/core/RLock.java +++ b/src/main/java/org/redisson/core/RLock.java @@ -27,8 +27,8 @@ import java.util.concurrent.locks.Lock; * */ -public interface RLock extends Lock, RObject { - +public interface RLock extends Lock, RExpirable { + /** * Acquires the lock. * @@ -36,27 +36,27 @@ public interface RLock extends Lock, RObject { * 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 have passed + * If the lock is acquired, it is held until unlock is invoked, + * or until leaseTime have passed * since the lock was granted - whichever comes first. - * - * @param leaseTime the maximum time to hold the lock after granting it, + * + * @param 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. + * If leaseTime is -1, hold the lock until explicitly unlocked. * @param unit the time unit of the {@code leaseTime} argument - * @throws InterruptedException - if the thread is interrupted before or during this method. + * @throws InterruptedException - if the thread is interrupted before or during this method. */ void lockInterruptibly(long leaseTime, TimeUnit unit) throws InterruptedException; /** - * Returns true as soon as the lock is acquired. - * If the lock is currently held by another thread in this or any - * other process in the distributed system this method keeps trying - * to acquire the lock for up to waitTime before - * giving up and returning false. If the lock is acquired, - * it is held until unlock is invoked, or until leaseTime + * Returns true as soon as the lock is acquired. + * If the lock is currently held by another thread in this or any + * other process in the distributed system this method keeps trying + * to acquire the lock for up to waitTime before + * giving up and returning false. If the lock is acquired, + * it is held until unlock is invoked, or until leaseTime * have passed since the lock was granted - whichever comes first. - * + * * @param waitTime the maximum time to aquire the lock * @param leaseTime * @param unit @@ -64,7 +64,7 @@ public interface RLock extends Lock, RObject { * @throws InterruptedException */ boolean tryLock(long waitTime, long leaseTime, TimeUnit unit) throws InterruptedException; - + /** * Acquires the lock. * @@ -72,18 +72,18 @@ public interface RLock extends Lock, RObject { * 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 + * 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. - * - * @param leaseTime the maximum time to hold the lock after granting it, + * + * @param 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. + * If leaseTime is -1, hold the lock until explicitly unlocked. * @param unit the time unit of the {@code leaseTime} argument - * + * */ void lock(long leaseTime, TimeUnit unit); - + /** * Unlocks lock independently of state *