Java tutorial
//package com.java2s; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; public class Main { protected static ThreadFactory tdfContainer; public static Thread newThread(Runnable r) { return getThreadFactory().newThread(r); } protected static synchronized ThreadFactory getThreadFactory() { return null != tdfContainer ? tdfContainer : (tdfContainer = Executors.defaultThreadFactory()); } }