Interface TryLock


public interface TryLock
Implements a subset of lock with only trylock/unlock.
  • Method Details

    • tryLock

      boolean tryLock()
      Tries to get a lock.
      Returns:
      true if the lock was acquired and false otherwise
    • unlock

      void unlock()
      Unlock.
    • create

      static TryLock create(Supplier<Boolean> tryLock, Runnable unlock)