public interface LockExt extends Lock
Lock
features with convenient functionality.DEBUG, DEFAULT_TIMEOUT, TIMEOUT, TRACE_LOCK
Modifier and Type | Method and Description |
---|---|
Thread |
getOwner() |
boolean |
isLockedByOtherThread() |
boolean |
isOwner() |
boolean |
isOwner(Thread thread) |
void |
unlock(Runnable taskAfterUnlockBeforeNotify)
Execute the
Runnable taskAfterUnlockBeforeNotify while holding the exclusive lock. |
void |
validateLocked() |
Thread getOwner()
boolean isLockedByOtherThread()
boolean isOwner()
boolean isOwner(Thread thread)
void validateLocked() throws RuntimeException
RuntimeException
- if current thread does not hold the lockvoid unlock(Runnable taskAfterUnlockBeforeNotify)
Runnable taskAfterUnlockBeforeNotify
while holding the exclusive lock.
Then release the lock.