LinkedBlockingDeque改成LinkedBlockingQueue

This commit is contained in:
mxd 2019-10-14 17:26:44 +08:00
parent 92a7ed1f89
commit b7d461ffda

View File

@ -1,7 +1,7 @@
package org.spiderflow.concurrent;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@ -22,7 +22,7 @@ public class SpiderFlowThreadPoolExecutor {
public SpiderFlowThreadPoolExecutor(int maxThreads) {
super();
this.maxThreads = maxThreads;
this.executor = new ThreadPoolExecutor(maxThreads, maxThreads, 10, TimeUnit.MILLISECONDS, new LinkedBlockingDeque<>(),new ThreadFactory() {
this.executor = new ThreadPoolExecutor(maxThreads, maxThreads, 10, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(),new ThreadFactory() {
@Override
public Thread newThread(Runnable runnable) {