Class NamedSimpleReentrantLock.AcquireResult

    • Constructor Detail

      • AcquireResult

        public AcquireResult()
    • Method Detail

      • wasAcquired

        public abstract boolean wasAcquired()
        Indication whether the lock operation succeeded, in which case this method returns true. This does not mean that the lock is still being held.
        Returns:
        True if the lock was successfully acquired by the operation which produced this object.
      • close

        public abstract void close()
        Revert the lock operation. If wasAcquired() returns true, this method releases the underlying lock in an idempotent way. If wasAcquired() returns false, this method does nothing.
        Specified by:
        close in interface AutoCloseable