Class Locks


  • public final class Locks
    extends Object
    A utility class to create ExtendedLock objects.
    • Method Detail

      • reentrantLock

        @NotNull
        public static ExtendedLock reentrantLock()
        Create a standard reentrant ExtendedLock with the default fairness policy.
        Returns:
        a reentrant ExtendedLock
      • reentrantLock

        @NotNull
        public static ExtendedLock reentrantLock​(boolean fair)
        Create a standard reentrant ExtendedLock with the given fairness policy.
        Parameters:
        fair - the fairness policy
        Returns:
        a reentrant ExtendedLock