Interface RLockAsync

    • Method Detail

      • forceUnlockAsync

        RFuture<Boolean> forceUnlockAsync()
        Unlocks lock independently of state
        Returns:
        true if unlocked otherwise false
      • unlockAsync

        RFuture<Void> unlockAsync​(long threadId)
      • lockAsync

        RFuture<Void> lockAsync​(long threadId)
      • lockAsync

        RFuture<Void> lockAsync​(long leaseTime,
                                TimeUnit unit)
        Acquires the lock.

        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.

        Parameters:
        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 argument
        Returns:
        void
      • tryLockAsync

        RFuture<Boolean> tryLockAsync​(long waitTime,
                                      long leaseTime,
                                      TimeUnit unit,
                                      long threadId)
      • getHoldCountAsync

        RFuture<Integer> getHoldCountAsync()
        Number of holds on this lock by the current thread
        Returns:
        holds or 0 if this lock is not held by current thread