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

com.wepay.waltz.common.util.DaemonThreadFactory Maven / Gradle / Ivy

There is a newer version: 0.13.2
Show newest version
package com.wepay.waltz.common.util;

import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;

public class DaemonThreadFactory implements ThreadFactory {

    public static final ThreadFactory INSTANCE = new DaemonThreadFactory();

    private final ThreadFactory delegate = Executors.defaultThreadFactory();

    @Override
    public Thread newThread(Runnable r) {
        Thread thread = delegate.newThread(r);
        thread.setDaemon(true);

        return thread;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy