ARTEMIS-1334 Scheduled component shouldn't be synchronized

(cherry picked from commit 8bc15b1199)
This commit is contained in:
Clebert Suconic 2017-08-08 16:00:01 -04:00
parent 0c5962f1b8
commit 393cf9bfef
1 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ public abstract class ActiveMQScheduledComponent implements ActiveMQComponent, R
private long millisecondsPeriod; private long millisecondsPeriod;
private TimeUnit timeUnit; private TimeUnit timeUnit;
private final Executor executor; private final Executor executor;
private ScheduledFuture future; private volatile ScheduledFuture future;
private final boolean onDemand; private final boolean onDemand;
long lastTime = 0; long lastTime = 0;
@ -144,7 +144,7 @@ public abstract class ActiveMQScheduledComponent implements ActiveMQComponent, R
} }
@Override @Override
public synchronized void stop() { public void stop() {
if (future != null) { if (future != null) {
future.cancel(false); future.cancel(false);
future = null; future = null;