| | |
| | | |
| | | 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; |