public abstract class AbstractTSQueueLock
extends net.openhft.chronicle.core.io.AbstractCloseable
implements net.openhft.chronicle.core.io.Closeable
Modifier and Type | Field and Description |
---|---|
protected boolean |
dontRecoverLockTimeout |
protected net.openhft.chronicle.core.values.LongValue |
lock |
protected File |
path |
protected net.openhft.chronicle.threads.TimingPauser |
pauser |
protected static long |
PID |
protected TableStore |
tableStore |
static long |
UNLOCKED |
Constructor and Description |
---|
AbstractTSQueueLock(String lockKey,
TableStore<?> tableStore,
Supplier<net.openhft.chronicle.threads.TimingPauser> pauser) |
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() |
protected boolean |
threadSafetyCheck(boolean isUsed) |
String |
toString() |
assertCloseablesClosed, clearUsedByThread, close, createdHere, disableCloseableTracing, enableCloseableTracing, isClosed, isClosing, isInUserThread, performCloseInBackground, referenceId, resetUsedByThread, shouldPerformCloseInBackground, shouldWaitForClosed, throwExceptionIfClosed, throwExceptionIfClosedInSetter, unmonitor, waitForCloseablesToClose, waitForClosed, warnAndCloseIfNotClosed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, closeQuietly, closeQuietly, notifyClosing, warnAndCloseIfNotClosed
protected static final long PID
public static final long UNLOCKED
protected final boolean dontRecoverLockTimeout
protected final net.openhft.chronicle.core.values.LongValue lock
protected final 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> pauser)
protected void performClose()
performClose
in class net.openhft.chronicle.core.io.AbstractCloseable
protected void forceUnlock(long value)
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.protected boolean threadSafetyCheck(boolean isUsed)
threadSafetyCheck
in class net.openhft.chronicle.core.io.AbstractCloseable
public long lockedBy()
public String toString()
toString
in class net.openhft.chronicle.core.io.AbstractCloseable
Copyright © 2021. All rights reserved.