Class NamedSimpleReentrantLock.Acquired
- java.lang.Object
-
- org.opendaylight.infrautils.utils.concurrent.NamedSimpleReentrantLock.AcquireResult
-
- org.opendaylight.infrautils.utils.concurrent.NamedSimpleReentrantLock.Acquired
-
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- NamedSimpleReentrantLock<T>
public static final class NamedSimpleReentrantLock.Acquired extends NamedSimpleReentrantLock.AcquireResult
Result of a successful lock operation, representing a single lease on the lock.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Revert the lock operation.booleanwasAcquired()Indication whether the lock operation succeeded, in which case this method returns true.
-
-
-
Method Detail
-
wasAcquired
public boolean wasAcquired()
Description copied from class:NamedSimpleReentrantLock.AcquireResultIndication whether the lock operation succeeded, in which case this method returns true. This does not mean that the lock is still being held.- Specified by:
wasAcquiredin classNamedSimpleReentrantLock.AcquireResult- Returns:
- True if the lock was successfully acquired by the operation which produced this object.
-
close
public void close()
Description copied from class:NamedSimpleReentrantLock.AcquireResultRevert the lock operation. IfNamedSimpleReentrantLock.AcquireResult.wasAcquired()returns true, this method releases the underlying lock in an idempotent way. IfNamedSimpleReentrantLock.AcquireResult.wasAcquired()returns false, this method does nothing.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classNamedSimpleReentrantLock.AcquireResult
-
-