List of usage examples for java.lang Thread Thread
public Thread(Runnable target, String name)
From source file:SyncBlock.java
private static Thread launch(final SyncBlock sb, String name) { Runnable r = new Runnable() { public void run() { print("in run()"); sb.doStuff();/*from w ww . j av a 2s .com*/ } }; Thread t = new Thread(r, name); t.start(); return t; }
From source file:Main.java
public static ThreadFactory daemonThreadFactory(final String name) { return new ThreadFactory() { @Override/* w ww . jav a 2 s.c om*/ public Thread newThread(Runnable runnable) { Thread result = new Thread(runnable, name); result.setDaemon(true); return result; } }; }