public class ConcurrencyUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
safeUnlock(Lock lock)
Safely releases the given
lock without failing if it is in an illegal state |
static void |
withLock(Lock lock,
CheckedRunnable delegate)
Execute the given
delegate between the boundaries of
the given lock. |
static <T> T |
withLock(Lock lock,
CheckedSupplier<T> supplier)
Returns the value of the given
supplier between the boundaries of
the given lock. |
public static void safeUnlock(Lock lock)
lock without failing if it is in an illegal statelock - a Lockpublic static <T> T withLock(Lock lock, CheckedSupplier<T> supplier)
supplier between the boundaries of
the given lock. It guarantees that the lock is releasedT - the generic type of the returned valuelock - a Locksupplier - a CheckedSupplierpublic static void withLock(Lock lock, CheckedRunnable delegate)
delegate between the boundaries of
the given lock. It guarantees that the lock is releasedlock - a Lockdelegate - a CheckedRunnableCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.