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, waitForClosed, warnAndCloseIfNotClosed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, closeQuietly, closeQuietly, notifyClosing
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 successful, more formally, returns true
if the lock was already unlocked, or the process that was holding the
lock is no longer running, or current process, otherwise false
is returned if it was able to remove the lock.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 © 2020. All rights reserved.