mirror of https://github.com/apache/activemq.git
AMQ-7439: AbstractMQTTSocket#getProtocolConverter: Race condition in double-checked locking object initialization
protocolConverter may be visible to other threads before its properties are set.
This commit is contained in:
parent
4a4880301f
commit
8fa772c8de
|
@ -144,8 +144,9 @@ public abstract class AbstractMQTTSocket extends TransportSupport implements MQT
|
|||
if (protocolConverter == null) {
|
||||
synchronized(this) {
|
||||
if (protocolConverter == null) {
|
||||
protocolConverter = new MQTTProtocolConverter(this, brokerService);
|
||||
IntrospectionSupport.setProperties(protocolConverter, transportOptions);
|
||||
MQTTProtocolConverter newProtocolConverter = new MQTTProtocolConverter(this, brokerService);
|
||||
IntrospectionSupport.setProperties(newProtocolConverter, transportOptions);
|
||||
protocolConverter = newProtocolConverter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue