Package boofcv.misc
Class VariableLockSet
java.lang.Object
boofcv.misc.VariableLockSet
Base class for a set of variables which are all controlled by a single lock
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isLocked()
Returns true if the lock is activevoid
lock()
boolean
lock
(long timeoutMS) boolean
Safe but with a timeout for aquiring the lockvoid
select
(long timeoutMS, VariableLockSet.SelectObject<T> select) Selects an object with a timeout for acquiring the lock.<T> T
select
(VariableLockSet.SelectObject<T> select) <T> T
selectNull
(long timeoutMS, VariableLockSet.SelectObjectNull<T> select) Selects an object with a timeout for acquiring the lock.<T> T
selectNull
(VariableLockSet.SelectObjectNull<T> select) void
unlock()
-
Field Details
-
lock
-
-
Constructor Details
-
VariableLockSet
public VariableLockSet()
-
-
Method Details
-
safe
-
select
-
safe
Safe but with a timeout for aquiring the lock -
select
public <T> VariableLockSet.SelectResults<T> select(long timeoutMS, VariableLockSet.SelectObject<T> select) Selects an object with a timeout for acquiring the lock.- Parameters:
timeoutMS
- How long it will wait to get the lock in millisecondsselect
- Function used to select object- Returns:
- Results which indicate of the lock was acquired and the found object
-
selectNull
-
selectNull
Selects an object with a timeout for acquiring the lock.- Parameters:
timeoutMS
- How long it will wait to get the lock in millisecondsselect
- Function used to select object- Returns:
- Results which indicate of the lock was acquired and the found object
-
lock
public void lock() -
lock
public boolean lock(long timeoutMS) -
unlock
public void unlock() -
isLocked
public boolean isLocked()Returns true if the lock is active
-