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 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 |
---|---|
boolean |
forceLockIfProcessIsDead() |
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 |
forceUnlockIfProcessIsDeadOrCurrentProcess()
force unlock only if the process that currently holds the lock is no-longer running or the current process is holding the lock
|
boolean |
isLockedByCurrentProcess(LongConsumer notCurrentProcessConsumer) |
long |
lockedBy() |
protected void |
performClose() |
protected boolean |
threadSafetyCheck(boolean isUsed) |
assertCloseablesClosed, clearUsedByThread, close, createdHere, disableCloseableTracing, enableCloseableTracing, isClosed, isClosing, isInUserThread, performCloseInBackground, referenceId, resetUsedByThread, shouldPerformCloseInBackground, shouldWaitForClosed, throwExceptionIfClosed, throwExceptionIfClosedInSetter, toString, unmonitor, waitForClosed, warnAndCloseIfNotClosed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, closeQuietly, closeQuietly, notifyClosing
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 forceUnlockIfProcessIsDeadOrCurrentProcess()
true
if successful, more formally, returns true
if the lock was already unlocked, the lock was held by this process or
the process that is holding the lock is no longer running, otherwise false
is returned to indicate that the lock could not be removedpublic 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, otherwise false
is returned if it was able to remove the lock.public boolean forceLockIfProcessIsDead()
true
if successful, more formally, returns true
if the lock was original unlocked, or the process that was holding the
lock is no longer running, otherwise false
is returned if it is locked by another processprotected boolean threadSafetyCheck(boolean isUsed)
threadSafetyCheck
in class net.openhft.chronicle.core.io.AbstractCloseable
public long lockedBy()
Copyright © 2020. All rights reserved.