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

com.alee.utils.concurrent.DaemonThreadFactory Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
package com.alee.utils.concurrent;

import java.util.concurrent.ThreadFactory;

/**
 * A thread factory that only produces daemon threads.
 *
 * @author Adolph C.
 */

public class DaemonThreadFactory implements ThreadFactory
{
    /**
     * Constructs a new daemon thread.
     *
     * @param r a runnable to be executed by new thread instance
     * @return constructed thread.
     */
    @Override
    public Thread newThread ( final Runnable r )
    {
        final Thread dThread = new Thread ( r );
        dThread.setDaemon ( true );
        return dThread;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy