27package jau.test.util.parallel.locks;
29import org.jau.sys.Debug;
37 public static final boolean DEBUG = Debug.debug(
"Lock");
40 public static final boolean TRACE_LOCK = Debug.isPropertyDefined(
"jogamp.debug.Lock.TraceLock",
true);
52 public static final long TIMEOUT = Debug.getLongProperty(
"jogamp.common.utils.locks.Lock.timeout",
true,
DEFAULT_TIMEOUT);
59 void lock() throws RuntimeException;
71 boolean tryLock(
long timeout) throws InterruptedException;
78 void unlock() throws RuntimeException;
Specifying a thread blocking lock implementation.
static final long TIMEOUT
The TIMEOUT for lock() in ms, defaults to DEFAULT_TIMEOUT.
static final boolean DEBUG
Enable via the property jogamp.debug.Lock
boolean tryLock(long timeout)
Blocking until the lock is acquired by this Thread or maxwait in ms is reached.
void lock()
Blocking until the lock is acquired by this Thread or TIMEOUT is reached.
void unlock()
Release the lock.
static final boolean TRACE_LOCK
Enable via the property jogamp.debug.Lock.TraceLock
static final long DEFAULT_TIMEOUT
The default TIMEOUT value, of {@value} ms.
boolean isLocked()
Query if locked.