Package org.wildfly.common.lock
Class Locks
- java.lang.Object
-
- org.wildfly.common.lock.Locks
-
public final class Locks extends java.lang.ObjectA utility class to createExtendedLockobjects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExtendedLockreentrantLock()Create a standard reentrantExtendedLockwith the default fairness policy.static ExtendedLockreentrantLock(boolean fair)Create a standard reentrantExtendedLockwith the given fairness policy.static ExtendedLockspinLock()Create a spin lock.
-
-
-
Method Detail
-
reentrantLock
@NotNull public static ExtendedLock reentrantLock()
Create a standard reentrantExtendedLockwith the default fairness policy.- Returns:
- a reentrant
ExtendedLock
-
reentrantLock
@NotNull public static ExtendedLock reentrantLock(boolean fair)
Create a standard reentrantExtendedLockwith 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:
SpinLock
-
-