@PublicApi public interface ClusterLock extends Lock
These are named locks available from com.atlassian.beehive.ClusterLockService.
Lock| Modifier and Type | Method and Description |
|---|---|
boolean |
isHeldByCurrentThread()
Queries if this lock is held by the current thread.
|
void |
lockInterruptibly() |
Condition |
newCondition()
This optional operation from the java
Lock interface is not supported in ClusterLock. |
boolean isHeldByCurrentThread()
This is equivalent to Thread.holdsLock(Object) for Java's intrinsic
monitor locks or ReentrantLock.isHeldByCurrentThread().
true if the current thread holds this lock; false otherwise@Nonnull Condition newCondition()
Lock interface is not supported in ClusterLock.newCondition in interface LockUnsupportedOperationException - alwaysvoid lockInterruptibly()
throws InterruptedException
WARNING: ClusterLock supports interruption of this method on a best-effort basis only.
All implementations will report interruption if the interrupted state exists prior to calling this method, but
the underlying lock mechanism is not guaranteed to support interruption of an already in-flight lock request.
The ability to interrupt a pending lockInterruptibly() call must not be relied upon for correctness.
lockInterruptibly in interface LockInterruptedException - if this thread is interrupted before calling this method, or if this thread is
interrupted while waiting for the lock and the implementation supports interruption.Copyright © 2019 Atlassian. All rights reserved.