Class FakeLock
java.lang.Object
uk.ac.ebi.utils.threading.fakelocks.FakeLock
- All Implemented Interfaces:
Lock
A fake lock, which doesn't actually lock anything.
This can be a quick/transparent replacement for code where thread safety is optional and the invoker can decide
if it needs it or not.
By using this fake lock where you are sure you don't need to manage concurrency, you'll improve in performance.
without having to change code that is based on locks.
- Author:
- brandizi
- Date:
- 9 Apr 2021
- See Also:
-
Constructor Details
-
FakeLock
public FakeLock()
-
-
Method Details
-
lock
public void lock() -
lockInterruptibly
- Specified by:
lockInterruptibly
in interfaceLock
- Throws:
InterruptedException
-
tryLock
public boolean tryLock() -
tryLock
- Specified by:
tryLock
in interfaceLock
- Throws:
InterruptedException
-
unlock
public void unlock() -
newCondition
- Specified by:
newCondition
in interfaceLock
-