io.spiffe.workloadapi.internal.ThreadUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-spiffe-core Show documentation
Show all versions of java-spiffe-core Show documentation
Core functionality to fetch, process and validate X.509 and JWT SVIDs and Bundles from the Workload API.
package io.spiffe.workloadapi.internal;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
public final class ThreadUtils {
private ThreadUtils() {
}
public static void await(CountDownLatch latch) {
try {
latch.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
public static boolean await(CountDownLatch latch, long timeout, TimeUnit unit) {
boolean result;
try {
result = latch.await(timeout, unit);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
result = false;
}
return result;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy