From f246cf2fa3e271d35dec499a0cfb28b9b0e23dd6 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Wed, 6 Jun 2018 21:29:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=BA=BF=E7=A8=8B=E7=A7=BB?= =?UTF-8?q?=E9=99=A4Jetty=E4=BE=9D=E8=B5=96=EF=BC=8C=E4=B8=BA=E5=90=8E?= =?UTF-8?q?=E7=BB=ADRPC=E6=A8=A1=E5=9D=97=E6=8B=86=E5=88=86=E5=81=9A?= =?UTF-8?q?=E5=87=86=E5=A4=87=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/xxl/job/core/thread/JobThread.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/thread/JobThread.java b/xxl-job-core/src/main/java/com/xxl/job/core/thread/JobThread.java index bc86a2c2..34993e26 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/thread/JobThread.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/thread/JobThread.java @@ -8,13 +8,15 @@ import com.xxl.job.core.handler.IJobHandler; import com.xxl.job.core.log.XxlJobFileAppender; import com.xxl.job.core.log.XxlJobLogger; import com.xxl.job.core.util.ShardingUtil; -import org.eclipse.jetty.util.ConcurrentHashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.PrintWriter; import java.io.StringWriter; +import java.util.Collections; import java.util.Date; +import java.util.HashSet; +import java.util.Set; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; @@ -28,7 +30,7 @@ public class JobThread extends Thread{ private int jobId; private IJobHandler handler; private LinkedBlockingQueue triggerQueue; - private ConcurrentHashSet triggerLogIdSet; // avoid repeat trigger for the same TRIGGER_LOG_ID + private Set triggerLogIdSet; // avoid repeat trigger for the same TRIGGER_LOG_ID private volatile boolean toStop = false; private String stopReason; @@ -41,7 +43,7 @@ public class JobThread extends Thread{ this.jobId = jobId; this.handler = handler; this.triggerQueue = new LinkedBlockingQueue(); - this.triggerLogIdSet = new ConcurrentHashSet(); + this.triggerLogIdSet = Collections.synchronizedSet(new HashSet()); } public IJobHandler getHandler() { return handler;