activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [activemq] branch master updated: [AMQ-7401] Make double-checked locking thread-safe by declaring the field volatile.
Date Mon, 10 Feb 2020 18:08:26 GMT
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/master by this push:
     new dac97e6  [AMQ-7401] Make double-checked locking thread-safe by declaring the field
volatile.
     new ff02246  [AMQ-7401] This closes #447
dac97e6 is described below

commit dac97e6294f796b93ee1e1b43aaa37566d2328ea
Author: Pascal Schumacher <pascalschumacher@gmx.net>
AuthorDate: Sun Feb 9 17:40:47 2020 +0100

    [AMQ-7401] Make double-checked locking thread-safe by declaring the field volatile.
---
 .../src/main/java/org/apache/activemq/ActiveMQConnection.java       | 2 +-
 .../src/main/java/org/apache/activemq/jms/pool/SessionHolder.java   | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java b/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java
index d95f871..6d8ce63 100644
--- a/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java
+++ b/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java
@@ -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;
diff --git a/activemq-jms-pool/src/main/java/org/apache/activemq/jms/pool/SessionHolder.java
b/activemq-jms-pool/src/main/java/org/apache/activemq/jms/pool/SessionHolder.java
index afa75d6..38b6a75 100644
--- a/activemq-jms-pool/src/main/java/org/apache/activemq/jms/pool/SessionHolder.java
+++ b/activemq-jms-pool/src/main/java/org/apache/activemq/jms/pool/SessionHolder.java
@@ -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;


Mime
View raw message