ARTEMIS-1408 document synchronization
This commit is contained in:
parent
6ad29e4039
commit
439761d6b8
|
@ -80,6 +80,7 @@ public class MQTTSessionState {
|
|||
}
|
||||
|
||||
boolean addSubscription(MqttTopicSubscription subscription, WildcardConfiguration wildcardConfiguration) {
|
||||
// synchronized to prevent race with removeSubscription
|
||||
synchronized (subscriptions) {
|
||||
addressMessageMap.putIfAbsent(MQTTUtil.convertMQTTAddressFilterToCore(subscription.topicName(), wildcardConfiguration), new ConcurrentHashMap<Long, Integer>());
|
||||
|
||||
|
@ -98,6 +99,7 @@ public class MQTTSessionState {
|
|||
}
|
||||
|
||||
void removeSubscription(String address) {
|
||||
// synchronized to prevent race with addSubscription
|
||||
synchronized (subscriptions) {
|
||||
subscriptions.remove(address);
|
||||
addressMessageMap.remove(address);
|
||||
|
|
Loading…
Reference in New Issue