public interface Lock
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG
Enable via the property
jogamp.debug.Lock |
static long |
DEFAULT_TIMEOUT
Defines the default
TIMEOUT value |
static long |
TIMEOUT
Defines the
TIMEOUT for lock() in ms,
and defaults to DEFAULT_TIMEOUT.It can be overridden via the system property jogamp.common.utils.locks.Lock.timeout. |
static boolean |
TRACE_LOCK
Enable via the property
jogamp.debug.Lock.TraceLock |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isLocked()
Query if locked
|
void |
lock()
Blocking until the lock is acquired by this Thread or
TIMEOUT is reached. |
boolean |
tryLock(long timeout)
Blocking until the lock is acquired by this Thread or
maxwait in ms is reached. |
void |
unlock()
Release the lock.
|
static final boolean TRACE_LOCK
jogamp.debug.Lock.TraceLockstatic final boolean DEBUG
jogamp.debug.Lockstatic final long DEFAULT_TIMEOUT
TIMEOUT valuestatic final long TIMEOUT
TIMEOUT for lock() in ms,
and defaults to DEFAULT_TIMEOUT.jogamp.common.utils.locks.Lock.timeout.void lock()
throws RuntimeException
TIMEOUT is reached.RuntimeException - in case of TIMEOUTboolean tryLock(long timeout)
throws InterruptedException
maxwait in ms is reached.timeout - Maximum 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.maxwait, otherwise falseInterruptedExceptionvoid unlock()
throws RuntimeException
RuntimeException - in case the lock is not acquired by this thread.boolean isLocked()