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
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisLocked()Returns true if the lock is activevoidlock()booleanlock(long timeoutMS) booleanSafe but with a timeout for aquiring the lockvoidselect(long timeoutMS, VariableLockSet.SelectObject<T> select) Selects an object with a timeout for acquiring the lock.<T> Tselect(VariableLockSet.SelectObject<T> select) <T> TselectNull(long timeoutMS, VariableLockSet.SelectObjectNull<T> select) Selects an object with a timeout for acquiring the lock.<T> TselectNull(VariableLockSet.SelectObjectNull<T> select) voidunlock()
-
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
-