public class TSQueueLock extends Object implements QueueLock
Constructor and Description |
---|
TSQueueLock(File queueDirectoryPath,
Supplier<net.openhft.chronicle.threads.Pauser> pauser) |
Modifier and Type | Method and Description |
---|---|
void |
acquireLock()
Stores current PID to table store, and any other process trying to acquire lock will wait for
chronicle.queue.lock.timeoutMS millis (default is 30000) for the lock to be released, and if it is not
after timeout, throws IllegalStateException . |
void |
checkLock()
checks if current thread holds lock.
|
void |
close() |
void |
unlock()
Checks if the lock is held by current thread and if so, releases it, removing entry from TableStore and clearing
ThreadLocal state, allowing anyone to proceed with
ChronicleQueue.acquireAppender() . |
public void acquireLock()
chronicle.queue.lock.timeoutMS
millis (default is 30000) for the lock to be released, and if it is not
after timeout, throws IllegalStateException
. Also the locking thread ID is stored in threadLocal field, so
that only locking thread is allowed to ChronicleQueue.acquireAppender()
while the queue is locked.acquireLock
in interface QueueLock
public void checkLock()
chronicle.queue.lock.timeoutMS
millis
for the lock to be released, and if it is not after timeout, throws IllegalStateException
.public void unlock()
ChronicleQueue.acquireAppender()
.public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2018. All rights reserved.