Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.locks.ReentrantReadWriteLock |
lock |
ONE_CENTURY, ONE_DAY, ONE_HOUR, ONE_MINUTE, ONE_SECOND, ONE_WEEK, ONE_YEAR
Modifier | Constructor and Description |
---|---|
private |
ReadWriteLockSync(java.util.concurrent.locks.ReentrantReadWriteLock lock) |
Modifier and Type | Method and Description |
---|---|
boolean |
isHeldByCurrentThread(LockType type)
Returns true is this is lock is held at given level by the current thread.
|
void |
lock(LockType type)
Acquire lock of LockType.READ or WRITE
|
boolean |
tryLock(LockType type,
long msec)
Tries to acquire a LockType.READ or WRITE for a certain period
|
void |
unlock(LockType type)
Releases the lock held by the current Thread.
|
private ReadWriteLockSync(java.util.concurrent.locks.ReentrantReadWriteLock lock)
public void lock(LockType type)
public boolean tryLock(LockType type, long msec) throws java.lang.InterruptedException
public void unlock(LockType type)
public boolean isHeldByCurrentThread(LockType type)
isHeldByCurrentThread
in interface Sync
type
- the lock type to test