Class LockTracking<T extends Lock>
java.lang.Object
org.eclipse.rdf4j.common.concurrent.locks.diagnostics.LockTracking<T>
- All Implemented Interfaces:
LockMonitoring<T>
@InternalUseOnly
public class LockTracking<T extends Lock>
extends Object
implements LockMonitoring<T>
Full tracking of locks with simple deadlock detection and logging as well as automatic release of abandoned locks
(same as LockCleaner).
- Author:
- HÃ¥vard M. Ottestad
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.rdf4j.common.concurrent.locks.diagnostics.LockMonitoring
LockMonitoring.Wrapper<T extends Lock>
-
Field Summary
Fields inherited from interface org.eclipse.rdf4j.common.concurrent.locks.diagnostics.LockMonitoring
INITIAL_WAIT_TO_COLLECT
-
Constructor Summary
ConstructorDescriptionLockTracking
(boolean stacktrace, String alias, org.slf4j.Logger logger, int waitToCollect, Lock.ExtendedSupplier<T> supplier) -
Method Summary
Modifier and TypeMethodDescriptiongetLock()
boolean
void
tryLock()
void
unregister
(Lock lock) unsafeInnerLock
(Lock lock)
-
Field Details
-
LOGGED_STALLED_LOCKS_MINIMUM_WAIT_TO_COLLECT
public static final int LOGGED_STALLED_LOCKS_MINIMUM_WAIT_TO_COLLECT- See Also:
-
-
Constructor Details
-
LockTracking
public LockTracking(boolean stacktrace, String alias, org.slf4j.Logger logger, int waitToCollect, Lock.ExtendedSupplier<T> supplier)
-
-
Method Details
-
runCleanup
public void runCleanup()- Specified by:
runCleanup
in interfaceLockMonitoring<T extends Lock>
-
getLock
- Specified by:
getLock
in interfaceLockMonitoring<T extends Lock>
- Throws:
InterruptedException
-
getLock
- Specified by:
getLock
in interfaceLockMonitoring<T extends Lock>
- Throws:
InterruptedException
-
unsafeInnerLock
- Specified by:
unsafeInnerLock
in interfaceLockMonitoring<T extends Lock>
-
tryLock
- Specified by:
tryLock
in interfaceLockMonitoring<T extends Lock>
-
requiresManualCleanup
public boolean requiresManualCleanup()- Specified by:
requiresManualCleanup
in interfaceLockMonitoring<T extends Lock>
-
register
- Specified by:
register
in interfaceLockMonitoring<T extends Lock>
-
unregister
- Specified by:
unregister
in interfaceLockMonitoring<T extends Lock>
-