| | |
| | | import java.util.concurrent.TimeUnit; |
| | | import org.springframework.scheduling.concurrent.CustomizableThreadFactory; |
| | | |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/report/utils/ThreadPoolUtil.class */ |
| | | |
| | | public class ThreadPoolUtil { |
| | | private static final int CORE_POOL_SIZE = 10; |
| | | private static final int MAX_POOL_SIZE = 20; |
| | |
| | | |
| | | public static ThreadPoolExecutor getThreadPool() { |
| | | if (Objects.isNull(executor)) { |
| | | executor = new ThreadPoolExecutor(CORE_POOL_SIZE, MAX_POOL_SIZE, KEEP_ALIVE_TIME, TimeUnit.SECONDS, new ArrayBlockingQueue(QUEUE_CAPACITY), new CustomizableThreadFactory("p-thread-exec-"), new ThreadPoolExecutor.CallerRunsPolicy()); |
| | | executor = new ThreadPoolExecutor(CORE_POOL_SIZE, MAX_POOL_SIZE, KEEP_ALIVE_TIME, TimeUnit.SECONDS, new ArrayBlockingQueue<>(QUEUE_CAPACITY), new CustomizableThreadFactory("p-thread-exec-"), new ThreadPoolExecutor.CallerRunsPolicy()); |
| | | return executor; |
| | | } |
| | | return executor; |