Class Locks


  • public final class Locks
    extends java.lang.Object
    A utility class to create ExtendedLock objects.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ExtendedLock reentrantLock()
      Create a standard reentrant ExtendedLock with the default fairness policy.
      static ExtendedLock reentrantLock​(boolean fair)
      Create a standard reentrant ExtendedLock with the given fairness policy.
      static ExtendedLock spinLock()
      Create a spin lock.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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