public static ThreadPoolExecutor newThreadPool(int corePoolSize, int maxPoolSize, long keepAliveInSec, String threadName) {
return new ThreadPoolExecutor(corePoolSize, maxPoolSize, keepAliveInSec, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory(threadName));
}
public static ThreadPoolExecutor newThreadPool(int corePoolSize, int maxPoolSize, long keepAliveInSec, String threadName, boolean daemon) {
return new ThreadPoolExecutor(corePoolSize, maxPoolSize, keepAliveInSec, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory(threadName, daemon));
}