Package boofcv.misc

Class VariableLockSet

java.lang.Object
boofcv.misc.VariableLockSet

public class VariableLockSet extends Object
Base class for a set of variables which are all controlled by a single lock
  • Field Details

  • Constructor Details

    • VariableLockSet

      public VariableLockSet()
  • Method Details

    • safe

      public void safe(Runnable r)
    • select

      public <T> T select(VariableLockSet.SelectObject<T> select)
    • safe

      public boolean safe(long timeoutMS, Runnable r)
      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 milliseconds
      select - Function used to select object
      Returns:
      Results which indicate of the lock was acquired and the found object
    • selectNull

      @Nullable public <T> T selectNull(VariableLockSet.SelectObjectNull<T> select)
    • selectNull

      @Nullable public <T> T selectNull(long timeoutMS, VariableLockSet.SelectObjectNull<T> select)
      Selects an object with a timeout for acquiring the lock.
      Parameters:
      timeoutMS - How long it will wait to get the lock in milliseconds
      select - 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