public static interface Theseus.LongLivedLock
extends java.lang.AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
default void |
close() |
boolean |
isCertainlyHeld()
Returns true if the lock represented is still certainly held.
|
boolean |
isPerhapsHeld()
Returns true if the lock represented has a chance of being held.
|
java.lang.String |
lockName()
Returns the name of the lock that is held.
|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
release()
This releases a lock, and cleans up any resources waiting on it.
|
java.lang.String lockName()
boolean isCertainlyHeld()
isPerhapsHeld() is always true as well, but not
visa versa.boolean isPerhapsHeld()
isCertainlyHeld() is false, in cases where we are in the process
of releasing the lock.
Note that unlike isCertainlyHeld(), this may never revert to false in rare cases when we cannot talk
to Raft effectively. Therefore, the caller should be wary of waiting on this function.java.util.concurrent.CompletableFuture<java.lang.Boolean> release()
default void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exception