public class StatementAgentInstanceLockRW extends Object implements StatementAgentInstanceLock
ReentrantReadWriteLock
that associates a
name with the lock and traces read/write locking and unlocking.ACQUIRE_TEXT, ACQUIRED_TEXT, RELEASE_TEXT, RELEASED_TEXT
Constructor and Description |
---|
StatementAgentInstanceLockRW(boolean isFair)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
acquireReadLock()
Lock read lock.
|
void |
acquireWriteLock()
Lock write lock.
|
boolean |
acquireWriteLock(long msecTimeout) |
boolean |
addAcquiredLock(Lock lock) |
void |
releaseReadLock()
Unlock read lock.
|
void |
releaseWriteLock()
Unlock write lock.
|
String |
toString() |
public StatementAgentInstanceLockRW(boolean isFair)
isFair
- true if a fair lock, false if notpublic void acquireWriteLock()
acquireWriteLock
in interface StatementAgentInstanceLock
public boolean acquireWriteLock(long msecTimeout)
acquireWriteLock
in interface StatementAgentInstanceLock
public void releaseWriteLock()
releaseWriteLock
in interface StatementAgentInstanceLock
public void acquireReadLock()
acquireReadLock
in interface StatementAgentInstanceLock
public void releaseReadLock()
releaseReadLock
in interface StatementAgentInstanceLock
public boolean addAcquiredLock(Lock lock)
Copyright © 2005–2019. All rights reserved.