GlueGen: com.jogamp.common.util.locks.ThreadLock Interface Reference

GlueGen v2.6.0-rc-20250822 GlueGen, Native Binding Generator for Java™ (public API).

Public Member Functions | List of all members
com.jogamp.common.util.locks.ThreadLock Interface Reference

Extending the `Lock` features with convenient functionality. More...

Inheritance diagram for com.jogamp.common.util.locks.ThreadLock:
Collaboration diagram for com.jogamp.common.util.locks.ThreadLock:

## Public Member Functions

boolean | isLockedByOtherThread ()
| Query whether the lock is hold by the a thread other than the current thread. More...
boolean | isOwner (Thread thread)
| Query whether the lock is hold by the given thread. More...
Thread | getOwner ()
void | validateLocked () throws RuntimeException
void | unlock (Runnable taskAfterUnlockBeforeNotify)
| Execute the `Runnable taskAfterUnlockBeforeNotify` while holding the exclusive lock. More...
Public Member Functions inherited from com.jogamp.common.util.locks.Lock
void | lock () throws RuntimeException
| Blocking until the lock is acquired by this Thread or `TIMEOUT` is reached. More...
boolean | tryLock (long timeout) throws InterruptedException
| Blocking until the lock is acquired by this Thread or `maxwait` in ms is reached. More...
void | unlock () throws RuntimeException
| Release the lock. More...
boolean | isLocked ()
| Query if locked. More...

## Additional Inherited Members

Static Public Attributes inherited from com.jogamp.common.util.locks.Lock
static final boolean | DEBUG = Debug.debug("Lock")
| Enable via the property `jogamp.debug.Lock` More...
static final boolean | TRACE_LOCK = Debug.isPropertyDefined("jogamp.debug.Lock.TraceLock", true)
| Enable via the property `jogamp.debug.Lock.TraceLock` More...
static final long | DEFAULT_TIMEOUT = 5000
| The default `TIMEOUT` value, of {@value} ms. More...
static final long | TIMEOUT = Debug.getLongProperty("jogamp.common.utils.locks.Lock.timeout", true, DEFAULT_TIMEOUT)
| The `TIMEOUT` for `lock()` in ms, defaults to `DEFAULT_TIMEOUT`. More...

## Detailed Description

Extending the `Lock` features with convenient functionality.

Definition at line 34 of file ThreadLock.java.

## Member Function Documentation

## ◆ getOwner()

Thread com.jogamp.common.util.locks.ThreadLock.getOwner | ( |  | ) |

Returns
  the Thread owning this lock if locked, otherwise null

## ◆ isLockedByOtherThread()

boolean com.jogamp.common.util.locks.ThreadLock.isLockedByOtherThread | ( |  | ) |

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

## ◆ isOwner()

boolean com.jogamp.common.util.locks.ThreadLock.isOwner | ( | Thread | thread | ) |

Query whether the lock is hold by the given thread.

## ◆ unlock()

void com.jogamp.common.util.locks.ThreadLock.unlock | ( | Runnable | taskAfterUnlockBeforeNotify | ) |

Execute the `Runnable taskAfterUnlockBeforeNotify` while holding the exclusive lock.

Then release the lock.

Implemented in com.jogamp.common.util.locks.RecursiveThreadGroupLock.

## ◆ validateLocked()

void com.jogamp.common.util.locks.ThreadLock.validateLocked | ( |  | ) | throws RuntimeException

Exceptions

  RuntimeException | if current thread does not hold the lock

The documentation for this interface was generated from the following file:

- src/java/com/jogamp/common/util/locks/ThreadLock.java