29package com.jogamp.common.util.locks;
31import jogamp.common.Debug;
39 public static final boolean DEBUG = Debug.debug(
"Lock");
42 public static final boolean TRACE_LOCK = Debug.isPropertyDefined(
"jogamp.debug.Lock.TraceLock",
true);
54 public static final long TIMEOUT = Debug.getLongProperty(
"jogamp.common.utils.locks.Lock.timeout",
true,
DEFAULT_TIMEOUT);
61 void lock() throws RuntimeException;
73 boolean tryLock(
long timeout) throws InterruptedException;
80 void unlock() throws RuntimeException;
Specifying a thread blocking lock implementation.
static final boolean TRACE_LOCK
Enable via the property jogamp.debug.Lock.TraceLock
boolean tryLock(long timeout)
Blocking until the lock is acquired by this Thread or maxwait in ms is reached.
static final long TIMEOUT
The TIMEOUT for lock() in ms, defaults to DEFAULT_TIMEOUT.
void unlock()
Release the lock.
static final long DEFAULT_TIMEOUT
The default TIMEOUT value, of {@value} ms.
void lock()
Blocking until the lock is acquired by this Thread or TIMEOUT is reached.
static final boolean DEBUG
Enable via the property jogamp.debug.Lock
boolean isLocked()
Query if locked.