Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.concurrent.ThreadFactory; public class Main { public static ThreadFactory threadFactory(final String name, final boolean daemon) { return new ThreadFactory() { @Override public Thread newThread(Runnable runnable) { Thread result = new Thread(runnable, name); result.setDaemon(daemon); return result; } }; } }