public interface Lock extends AutoCloseable
AutoCloseable
resource, so will be released automatically if declared in a try
-with-resources block.Modifier and Type | Method and Description |
---|---|
default void |
close()
Releases this lock.
|
boolean |
isHeld()
Indicates whether the lock is still owned
true , or whether it has been released false . |
void |
release()
Releases this lock.
|
default void close()
release()
.
close
in interface AutoCloseable
void release()
boolean isHeld()
true
, or whether it has been released false
.Copyright © 2010–2024. All rights reserved.