GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
com.jogamp.common.util.locks.Lock Interface Reference

Specifying a thread blocking lock implementation. More...

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

Public Member Functions

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...
 

Static Public Attributes

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

Specifying a thread blocking lock implementation.

Definition at line 36 of file Lock.java.

Member Function Documentation

◆ isLocked()

boolean com.jogamp.common.util.locks.Lock.isLocked ( )

Query if locked.

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

◆ lock()

void com.jogamp.common.util.locks.Lock.lock ( ) throws RuntimeException

Blocking until the lock is acquired by this Thread or TIMEOUT is reached.

Exceptions
RuntimeExceptionin case of TIMEOUT

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

◆ tryLock()

boolean com.jogamp.common.util.locks.Lock.tryLock ( long  timeout) throws InterruptedException

Blocking until the lock is acquired by this Thread or maxwait in ms is reached.

Parameters
timeoutMaximum time in ms to wait to acquire the lock. If this value is zero, the call returns immediately either without being able to acquire the lock, or with acquiring the lock directly while ignoring any scheduling order.
Returns
true if the lock has been acquired within maxwait, otherwise false
Exceptions
InterruptedException

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

◆ unlock()

void com.jogamp.common.util.locks.Lock.unlock ( ) throws RuntimeException

Release the lock.

Exceptions
RuntimeExceptionin case the lock is not acquired by this thread.

Implemented in com.jogamp.common.util.locks.RecursiveThreadGroupLock, and com.jogamp.common.util.locks.SingletonInstance.

Member Data Documentation

◆ DEBUG

final boolean com.jogamp.common.util.locks.Lock.DEBUG = Debug.debug("Lock")
static

Enable via the property jogamp.debug.Lock

Definition at line 39 of file Lock.java.

◆ DEFAULT_TIMEOUT

final long com.jogamp.common.util.locks.Lock.DEFAULT_TIMEOUT = 5000
static

The default TIMEOUT value, of {@value} ms.

Definition at line 45 of file Lock.java.

◆ TIMEOUT

final long com.jogamp.common.util.locks.Lock.TIMEOUT = Debug.getLongProperty("jogamp.common.utils.locks.Lock.timeout", true, DEFAULT_TIMEOUT)
static

The TIMEOUT for lock() in ms, defaults to DEFAULT_TIMEOUT.

It can be overridden via the system property jogamp.common.utils.locks.Lock.timeout.

Definition at line 54 of file Lock.java.

◆ TRACE_LOCK

final boolean com.jogamp.common.util.locks.Lock.TRACE_LOCK = Debug.isPropertyDefined("jogamp.debug.Lock.TraceLock", true)
static

Enable via the property jogamp.debug.Lock.TraceLock

Definition at line 42 of file Lock.java.


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