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

org.jruby.threading.DaemonThreadFactory Maven / Gradle / Ivy

There is a newer version: 9.4.7.0
Show newest version
package org.jruby.threading;

import java.util.concurrent.ThreadFactory;

/**
 * A ThreadFactory for when we're using pooled threads; we want to create
 * the threads with daemon = true so they don't keep us from shutting down.
 */
public class DaemonThreadFactory implements ThreadFactory {
    public Thread newThread(Runnable runnable) {
        Thread thread = new Thread(runnable);
        thread.setDaemon(true);

        return thread;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy