Package com.jogamp.common.util.locks
Interface ThreadLock
- All Superinterfaces:
Lock
- All Known Subinterfaces:
RecursiveLock,RecursiveThreadGroupLock
Extending the
Lock features with convenient functionality.-
Field Summary
Fields inherited from interface com.jogamp.common.util.locks.Lock
DEBUG, DEFAULT_TIMEOUT, TIMEOUT, TRACE_LOCK -
Method Summary
Modifier and TypeMethodDescriptiongetOwner()booleanQuery whether the lock is hold by the a thread other than the current thread.booleanQuery whether the lock is hold by the given thread.voidExecute theRunnable taskAfterUnlockBeforeNotifywhile holding the exclusive lock.void
-
Method Details
-
isLockedByOtherThread
boolean isLockedByOtherThread()Query whether the lock is hold by the a thread other than the current thread. -
isOwner
Query whether the lock is hold by the given thread. -
getOwner
Thread getOwner()- Returns:
- the Thread owning this lock if locked, otherwise null
-
validateLocked
- Throws:
RuntimeException- if current thread does not hold the lock
-
unlock
Execute theRunnable taskAfterUnlockBeforeNotifywhile holding the exclusive lock.Then release the lock.
-