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