All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.spiffe.workloadapi.internal.ThreadUtils Maven / Gradle / Ivy

Go to download

Core functionality to fetch, process and validate X.509 and JWT SVIDs and Bundles from the Workload API.

There is a newer version: 0.8.11
Show newest version
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