summaryrefslogtreecommitdiff
path: root/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java')
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
index f6537e0375..3969eef8a9 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
@@ -227,7 +227,7 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect
* Whether this connection is started, i.e. whether messages are flowing to consumers. It has no meaning for message
* publication.
*/
- protected boolean _started;
+ protected volatile boolean _started;
/** Policy dictating how to failover */
protected FailoverPolicy _failoverPolicy;
@@ -862,6 +862,7 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect
checkNotClosed();
if (!_started)
{
+ _started = true;
final Iterator it = _sessions.values().iterator();
while (it.hasNext())
{
@@ -876,7 +877,7 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect
}
}
- _started = true;
+
}
}