class NamedThreadFactory implements ThreadFactory {

    @Override
    public Thread newThread(Runnable r) {
        String name = prefix + "_" + counter.incrementAndGet();
        if (totalSize > 1) {
            name += "_" + totalSize;
        }
        Thread thread = new FastThreadLocalThread(r, name);

        thread.setDaemon(makeDaemons);
        if (thread.getPriority() != Thread.NORM_PRIORITY) {
            thread.setPriority(Thread.NORM_PRIORITY);
        }
        return thread;
    }

    public  NamedThreadFactory(String prefix, int totalSize, boolean makeDaemons);
    public  NamedThreadFactory(String prefix, boolean makeDaemons);
    public  NamedThreadFactory(String prefix, int totalSize);

}