com.github.dreamhead.moco.util.Locks Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of moco-core Show documentation
Show all versions of moco-core Show documentation
Moco is an easy setup stub framework, mainly focusing on testing and integration.
package com.github.dreamhead.moco.util;
import java.util.concurrent.locks.Lock;
public class Locks {
public static void withLock(final Lock lock, final Runnable runnable) {
lock.lock();
try {
runnable.run();
} finally {
lock.unlock();
}
}
private Locks() {
}
}