From 9a4b459ad35b250411d9f88b940ee4e48077c494 Mon Sep 17 00:00:00 2001 From: dongtsai Date: Sat, 13 Jul 2024 16:35:11 +0800 Subject: [PATCH] Update CocoaMQTT.swift marke properties thread safe --- Source/CocoaMQTT.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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