Positive example:
//org.apache.commons.lang3.concurrent.BasicThreadFactory
ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(1,
new BasicThreadFactory.Builder().namingPattern("example-schedule-pool-%d").daemon(true).build());
问题描述 : 线程池不允许使用Executors创建,防止允许的创建线程数量为Integer.MAX_VALUE,但是示例中(如下)给出的改进方案中,允许创建线程数量也是Integer.MAX_VALUE
Positive example: //org.apache.commons.lang3.concurrent.BasicThreadFactory ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(1, new BasicThreadFactory.Builder().namingPattern("example-schedule-pool-%d").daemon(true).build());