public abstract class AbstractTSQueueLock
extends net.openhft.chronicle.core.io.AbstractCloseable
implements net.openhft.chronicle.core.io.Closeable
LongValue
and primitives such as CAS.
WARNING: the default behaviour (see also queue.dont.recover.lock.timeout
system property) is
for a timed-out lock to be overridden.
Modifier and Type | Field and Description |
---|---|
protected UnlockMode |
forceUnlockOnTimeoutWhen |
protected net.openhft.chronicle.core.values.LongValue |
lock |
protected File |
path |
protected ThreadLocal<net.openhft.chronicle.threads.TimingPauser> |
pauser |
protected static long |
PID |
protected TableStore |
tableStore |
protected static String |
UNLOCK_MAIN_MSG |
static long |
UNLOCKED |
protected static String |
UNLOCKING_FORCIBLY_MSG |
Constructor and Description |
---|
AbstractTSQueueLock(String lockKey,
TableStore<?> tableStore,
Supplier<net.openhft.chronicle.threads.TimingPauser> pauserSupplier) |
Modifier and Type | Method and Description |
---|---|
protected void |
forceUnlock(long value)
will only force unlock if you give it the correct pid
|
boolean |
forceUnlockIfProcessIsDead()
forces an unlock only if the process that currently holds the table store lock is no-longer running
|
boolean |
isLockedByCurrentProcess(LongConsumer notCurrentProcessConsumer) |
long |
lockedBy() |
protected void |
performClose() |
String |
toString() |
assertCloseable, assertCloseablesClosed, clearUsedByThread, close, createdHere, disableCloseableTracing, disableThreadSafetyCheck, disableThreadSafetyCheck, enableCloseableTracing, gcAndWaitForCloseablesToClose, isClosed, isClosing, isInUserThread, referenceId, resetUsedByThread, shouldPerformCloseInBackground, shouldWaitForClosed, singleThreadedCheckDisabled, singleThreadedCheckDisabled, singleThreadedCheckReset, threadSafetyCheck, throwExceptionIfClosed, throwExceptionIfClosedInSetter, unmonitor, waitForCloseablesToClose, waitForClosed, warnAndCloseIfNotClosed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected static final String UNLOCK_MAIN_MSG
protected static final String UNLOCKING_FORCIBLY_MSG
protected static final long PID
public static final long UNLOCKED
protected final UnlockMode forceUnlockOnTimeoutWhen
protected final net.openhft.chronicle.core.values.LongValue lock
protected final ThreadLocal<net.openhft.chronicle.threads.TimingPauser> pauser
protected final File path
protected final TableStore tableStore
public AbstractTSQueueLock(String lockKey, TableStore<?> tableStore, Supplier<net.openhft.chronicle.threads.TimingPauser> pauserSupplier)
protected void performClose()
performClose
in class net.openhft.chronicle.core.io.AbstractCloseable
protected void forceUnlock(long value)
public boolean isLockedByCurrentProcess(LongConsumer notCurrentProcessConsumer)
public boolean forceUnlockIfProcessIsDead()
true
if the lock was already unlocked, It will not release the lock if it is held by this process
or the process that was holding the lock is no longer running (and we were able to unlock).
Otherwise false
is returned if the lock is held by this process or another live process.public long lockedBy()
public String toString()
toString
in class net.openhft.chronicle.core.io.AbstractCloseable
Copyright © 2022. All rights reserved.