- All Superinterfaces:
AutoCloseable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Unlocks the lock on
close()
, intended for use with try-with-resources.
Implementations do not guard against multiple invocations of close()
. That means, each call to close
will result in an Lock.unlock()
or equivalent.
- Since:
- 5
- Author:
- Mark Rotteveel
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LockCloseable
Lock closeable that can be used as a no-op (e.g. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Performs anLock.unlock()
or equivalent on the lock.
-
Field Details
-
NO_OP
Lock closeable that can be used as a no-op (e.g. if there is no lock, and thus nothing to unlock).
-
-
Method Details
-
close
void close()Performs anLock.unlock()
or equivalent on the lock.- Specified by:
close
in interfaceAutoCloseable
-