|
|
|
@@ -14,8 +14,8 @@ import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
@Component |
|
|
|
public class ThreadPoolService { |
|
|
|
|
|
|
|
private final Integer coreSize = 2; |
|
|
|
private final Integer maxSize = 2 * Runtime.getRuntime().availableProcessors(); |
|
|
|
private static final Integer CORE_SIZE = 2; |
|
|
|
private static Integer MAX_SIZE = 2 * Runtime.getRuntime().availableProcessors(); |
|
|
|
private final String prefix = "fm-thread-pool-"; |
|
|
|
|
|
|
|
private final AtomicInteger nextId = new AtomicInteger(); |
|
|
|
@@ -26,7 +26,7 @@ public class ThreadPoolService { |
|
|
|
private volatile ThreadPoolExecutor service; |
|
|
|
|
|
|
|
private ThreadPoolService() { |
|
|
|
getExecutorService(Integer.MAX_VALUE, Integer.MAX_VALUE); |
|
|
|
getExecutorService(CORE_SIZE, MAX_SIZE); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|