member variable scheduler assignment escapes the synchronization block
before the scheduler instance is fully initialized.
This commit is contained in:
Timothy Bish 2014-07-18 10:11:25 -04:00
parent 3c69127524
commit d54e0d6ab5
1 changed files with 3 additions and 2 deletions

View File

@ -2556,8 +2556,9 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
if (result == null) {
checkClosed();
try {
result = scheduler = new Scheduler("ActiveMQConnection["+info.getConnectionId().getValue()+"] Scheduler");
scheduler.start();
result = new Scheduler("ActiveMQConnection["+info.getConnectionId().getValue()+"] Scheduler");
result.start();
scheduler = result;
} catch(Exception e) {
throw JMSExceptionSupport.create(e);
}