Skip to content

Commit da39b71

Browse files
author
liushuai1
committed
provider LifecycleRunnableDelegate for remove
1 parent 0d8e4ba commit da39b71

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

taskscheduler/src/main/java/com/silencedut/taskscheduler/TaskScheduler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,10 @@ private static TaskScheduler getInstance() {
7575
private TaskScheduler() {
7676

7777

78-
mParallelExecutor = new ThreadPoolExecutor(CPU_COUNT,MAXIMUM_POOL_SIZE,
78+
mParallelExecutor = new ThreadPoolExecutor(CORE_POOL_SIZE,MAXIMUM_POOL_SIZE,
7979
KEEP_ALIVE,TimeUnit.SECONDS,POOL_WORK_QUEUE,ThreadFactory.TASKSCHEDULER_FACTORY);
8080

8181

82-
8382
/*
8483
没有核心线程的线程池要用 SynchronousQueue 而不是LinkedBlockingQueue,SynchronousQueue是一个只有一个任务的队列,
8584
这样每次就会创建非核心线程执行任务,因为线程池任务放入队列的优先级比创建非核心线程优先级大.

0 commit comments

Comments
 (0)