Consistent volatile access to running flag in Lifecycle implementations
Issue: SPR-16488
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -80,7 +80,7 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
|
||||
|
||||
private boolean active = false;
|
||||
|
||||
private boolean running = false;
|
||||
private volatile boolean running = false;
|
||||
|
||||
private final List<Object> pausedTasks = new LinkedList<>();
|
||||
|
||||
@@ -350,9 +350,7 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
|
||||
*/
|
||||
@Override
|
||||
public final boolean isRunning() {
|
||||
synchronized (this.lifecycleMonitor) {
|
||||
return (this.running && runningAllowed());
|
||||
}
|
||||
return (this.running && runningAllowed());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user