[AMQ-7401] Make double-checked locking thread-safe by declaring the field volatile.

This commit is contained in:
Pascal Schumacher 2020-02-09 17:40:47 +01:00 committed by jbonofre
parent 78826c9c73
commit dac97e6294
2 changed files with 4 additions and 4 deletions

View File

@ -199,7 +199,7 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
private boolean useDedicatedTaskRunner;
protected AtomicInteger transportInterruptionProcessingComplete = new AtomicInteger(0);
private long consumerFailoverRedeliveryWaitPeriod;
private Scheduler scheduler;
private volatile Scheduler scheduler;
private boolean messagePrioritySupported = false;
private boolean transactedIndividualAck = false;
private boolean nonBlockingRedelivery = false;

View File

@ -33,9 +33,9 @@ import javax.jms.TopicSession;
public class SessionHolder {
private final Session session;
private MessageProducer producer;
private TopicPublisher publisher;
private QueueSender sender;
private volatile MessageProducer producer;
private volatile TopicPublisher publisher;
private volatile QueueSender sender;
public SessionHolder(Session session) {
this.session = session;