Class Locks

java.lang.Object
org.wildfly.common.lock.Locks

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

    • 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
    • spinLock

      @NotNull public static ExtendedLock spinLock()
      Create a spin lock.
      Returns:
      the spin lock
      See Also: