Package org.apache.nifi.util.concurrency
Class DebugEnabledTimedLock
java.lang.Object
org.apache.nifi.util.concurrency.DebugEnabledTimedLock
- All Implemented Interfaces:
DebuggableTimedLock
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
lock
-
logger
private final org.slf4j.Logger logger -
lockTime
private long lockTime -
lockIterations
-
lockNanos
-
name
-
iterationFrequency
private final int iterationFrequency
-
-
Constructor Details
-
DebugEnabledTimedLock
-
-
Method Details
-
tryLock
public boolean tryLock()- Specified by:
tryLock
in interfaceDebuggableTimedLock
- Returns:
- true if lock obtained; false otherwise
-
tryLock
- Specified by:
tryLock
in interfaceDebuggableTimedLock
- Parameters:
timeout
- duration to wait for locktimeUnit
- unit to understand given duration- Returns:
- true if lock obtained in time; false otherwise
-
lock
public void lock()- Specified by:
lock
in interfaceDebuggableTimedLock
-
unlock
- Specified by:
unlock
in interfaceDebuggableTimedLock
- Parameters:
task
- to release the lock for
-