diff --git a/Source/CocoaMQTT.swift b/Source/CocoaMQTT.swift index cb462c37..b4935310 100644 --- a/Source/CocoaMQTT.swift +++ b/Source/CocoaMQTT.swift @@ -264,10 +264,10 @@ public class CocoaMQTT: NSObject, CocoaMQTTClient { } /// The subscribed topics in current communication - public var subscriptions: [String: CocoaMQTTQoS] = [:] + public var subscriptions = ThreadSafeDictionary(label: "subscriptions") - fileprivate var subscriptionsWaitingAck: [UInt16: [(String, CocoaMQTTQoS)]] = [:] - fileprivate var unsubscriptionsWaitingAck: [UInt16: [String]] = [:] + fileprivate var subscriptionsWaitingAck = ThreadSafeDictionary(label: "subscriptionsWaitingAck") + fileprivate var unsubscriptionsWaitingAck = ThreadSafeDictionary(label: "unsubscriptionsWaitingAck") /// Sending messages