From 43753d6e3e10b62d8012cc24425b6eab2707e7ce Mon Sep 17 00:00:00 2001 From: dongeforever Date: Thu, 13 Dec 2018 21:05:01 +0800 Subject: [PATCH] Polish makeStop for ServiceThread --- .../main/java/org/apache/rocketmq/common/ServiceThread.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/org/apache/rocketmq/common/ServiceThread.java b/common/src/main/java/org/apache/rocketmq/common/ServiceThread.java index 0e33418f..ae46e78f 100644 --- a/common/src/main/java/org/apache/rocketmq/common/ServiceThread.java +++ b/common/src/main/java/org/apache/rocketmq/common/ServiceThread.java @@ -97,7 +97,7 @@ public abstract class ServiceThread implements Runnable { @Deprecated public void stop(final boolean interrupt) { - if (!started.compareAndSet(true, false)) { + if (!started.get()) { return; } this.stopped = true; @@ -113,7 +113,7 @@ public abstract class ServiceThread implements Runnable { } public void makeStop() { - if (!started.compareAndSet(true, false)) { + if (!started.get()) { return; } this.stopped = true; -- GitLab