From 393cf9bfefc0bde17aad74db27743e99c50a47b7 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Tue, 8 Aug 2017 16:00:01 -0400 Subject: [PATCH] ARTEMIS-1334 Scheduled component shouldn't be synchronized (cherry picked from commit 8bc15b1199e9aa82c1cb92586deaba46174473ad) --- .../artemis/core/server/ActiveMQScheduledComponent.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQScheduledComponent.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQScheduledComponent.java index 7aeec1ebc2..e6c015e6f7 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQScheduledComponent.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQScheduledComponent.java @@ -41,7 +41,7 @@ public abstract class ActiveMQScheduledComponent implements ActiveMQComponent, R private long millisecondsPeriod; private TimeUnit timeUnit; private final Executor executor; - private ScheduledFuture future; + private volatile ScheduledFuture future; private final boolean onDemand; long lastTime = 0; @@ -144,7 +144,7 @@ public abstract class ActiveMQScheduledComponent implements ActiveMQComponent, R } @Override - public synchronized void stop() { + public void stop() { if (future != null) { future.cancel(false); future = null;