Top Description Fields Methods
com.jogamp.common.util.locks

public Interface ThreadLock

extends Lock
Known Direct Subinterfaces
com.jogamp.common.util.locks.RecursiveLock

Extending the Lock features with convenient functionality.

Field Summary

Inherited from com.jogamp.common.util.locks.Lock:
DEBUGDEFAULT_TIMEOUTTIMEOUTTRACE_LOCK

Method Summary

Modifier and TypeMethod and Description
public Thread

Returns:

the Thread owning this lock if locked, otherwise null
getOwner
()

public boolean
isLockedByOtherThread()

Query whether the lock is hold by the a thread other than the current thread.

public boolean
isOwner(Thread thread)

Query whether the lock is hold by the given thread.

public void
unlock(Runnable taskAfterUnlockBeforeNotify)

Execute the Runnable taskAfterUnlockBeforeNotify while holding the exclusive lock.

public void
Inherited from com.jogamp.common.util.locks.Lock:
isLockedlocktryLockunlock

Method Detail

getOwnerback to summary
public Thread getOwner()
Returns:Thread

the Thread owning this lock if locked, otherwise null

isLockedByOtherThreadback to summary
public boolean isLockedByOtherThread()

Query whether the lock is hold by the a thread other than the current thread.

isOwnerback to summary
public boolean isOwner(Thread thread)

Query whether the lock is hold by the given thread.

unlockback to summary
public void unlock(Runnable taskAfterUnlockBeforeNotify)

Execute the Runnable taskAfterUnlockBeforeNotify while holding the exclusive lock.

Then release the lock.

validateLockedback to summary
public void validateLocked() throws RuntimeException
Exceptions
RuntimeException:
if current thread does not hold the lock