public abstract static class NamedSimpleReentrantLock.AcquireResult extends Object implements AutoCloseable
wasAcquired()
.
Once the lock (acquired or otherwise) is no longer need, close()
needs to be invoked. This is typically
done through a try-with-resources block.Constructor and Description |
---|
AcquireResult() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Revert the lock operation.
|
abstract boolean |
wasAcquired()
Indication whether the lock operation succeeded, in which case this method returns true.
|
public abstract boolean wasAcquired()
public abstract void close()
wasAcquired()
returns true, this method releases the underlying lock
in an idempotent way. If wasAcquired()
returns false, this method does nothing.close
in interface AutoCloseable
Copyright © 2019 OpenDaylight. All rights reserved.