T - The type of objects which lock a reentrant lock (lock owning
object type).public interface LockNotification<T>
ReentrantLocks.
Notifications are sent after the state changed but still inside the atomic
part when locking/unlocking. Therefore implementations must have a very
short runtime. ConcurrentHashMap.| Modifier and Type | Method and Description |
|---|---|
void |
locked(ReentrantLock<T> reLock,
boolean writeLock,
T lockingObject,
int lockCount)
Signals that the designated reentrant lock has been locked by the
designated object for the designated number of times.
|
void |
unlocked(ReentrantLock<T> reLock,
boolean writeLock,
boolean isLocked,
boolean waitersForLock,
T lockingObject,
int lockCount)
Signals that the designated reentrant lock has been unlocked and provides
the number of times the lock is still held by the designated object.
|
void locked(ReentrantLock<T> reLock, boolean writeLock, T lockingObject, int lockCount)
reLock - The lock which has been acquired (or rather is currently
being acquired since the notification takes place while locking).writeLock - Whether the designated lock has been/is currently write
locked. An exclusive lock is always write locked.lockingObject - The object which has acquired the lock for the
designated number of times.lockCount - The number of times the lock the lock is currently being
held by the current locking object. In case of a read lock there
may be additional locks by other objects!void unlocked(ReentrantLock<T> reLock, boolean writeLock, boolean isLocked, boolean waitersForLock, T lockingObject, int lockCount)
reLock - The lock which has been released (or rather is currently
being released since the notification takes place while
unlocking).writeLock - Whether the designated lock has been/is currently unlocked
from writing. An exclusive lock is always write locked.isLocked - Whether the designated lock is still being held by the
designated locking object and/or by others.waitersForLock - Whether there are objects waiting for the designated
lock.lockingObject - The object which has released the lock and still helds
it for the designated number of times.lockCount - The number of times the lock the lock is still held by the
designated locking object after the current unlocking.