Merge branch 'V1.4'

# Conflicts:
#	src/main/java/com/jd/platform/async/executor/Async.java
#	src/main/java/com/jd/platform/async/wrapper/WorkerWrapper.java
This commit is contained in:
wuweifeng10 2021-11-11 11:01:09 +08:00
parent d7a08d0e61
commit 90cddd59ef

View File

@ -15,11 +15,10 @@ import java.util.stream.Collectors;
* @version 1.0
*/
public class Async {
private static final ThreadPoolExecutor COMMON_POOL =
new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors() * 2, 1024,
15L, TimeUnit.SECONDS,
new LinkedBlockingQueue<>(),
(ThreadFactory) Thread::new);
/**
* 默认不定长线程池
*/
private static final ThreadPoolExecutor COMMON_POOL = (ThreadPoolExecutor) Executors.newCachedThreadPool();
/**
* 注意这里是个static也就是只能有一个线程池用户自定义线程池时也只能定义一个
*/