org.entityfs.support.util.concurrent.locks
Class OwnerAwareReadLock
java.lang.Object
java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock
org.entityfs.support.util.concurrent.locks.OwnerAwareReadLock
- All Implemented Interfaces:
- Serializable, Lock
public final class OwnerAwareReadLock
- extends ReentrantReadWriteLock.ReadLock
- implements Lock, Serializable
There's no way of getting information on which threads that hold it from
Java's ReentrantReadWriteLock
's read lock. This class extends ReentrantReadWriteLock
's read lock to add that information.
This class also implement the Lock
interface. ReentrantReadWriteLock.ReadLock
does not do that.
- Since:
- 1.0
- Author:
- Karl Gustafsson
- See Also:
ReadLockOwnerAwareReentrantReadWriteLock
,
Serialized Form- In_jar:
- entityfs-core
lockInterruptibly
public void lockInterruptibly()
throws InterruptedException
- Specified by:
lockInterruptibly
in interface Lock
- Overrides:
lockInterruptibly
in class ReentrantReadWriteLock.ReadLock
- Throws:
InterruptedException
tryLock
public boolean tryLock()
- Specified by:
tryLock
in interface Lock
- Overrides:
tryLock
in class ReentrantReadWriteLock.ReadLock
tryLock
public boolean tryLock(long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
tryLock
in interface Lock
- Overrides:
tryLock
in class ReentrantReadWriteLock.ReadLock
- Throws:
InterruptedException
unlock
public void unlock()
- Specified by:
unlock
in interface Lock
- Overrides:
unlock
in class ReentrantReadWriteLock.ReadLock
lock
public void lock()
- Specified by:
lock
in interface Lock
- Overrides:
lock
in class ReentrantReadWriteLock.ReadLock
isHeldByCurrentThread
public boolean isHeldByCurrentThread()