File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,20 @@ class ProductsInfoController: NSObject {
4949 }
5050
5151 // As we can have multiple inflight requests, we store them in a dictionary by product ids
52- private var inflightRequests : [ Set < String > : InAppProductQuery ] = [ : ]
52+ private var inflightRequestsStorage : [ Set < String > : InAppProductQuery ] = [ : ]
53+ private let requestsQueue = DispatchQueue ( label: " inflightRequestsQueue " , attributes: . concurrent)
54+ private var inflightRequests : [ Set < String > : InAppProductQuery ] {
55+ get {
56+ requestsQueue. sync {
57+ inflightRequestsStorage
58+ }
59+ }
60+ set {
61+ requestsQueue. sync ( flags: . barrier) {
62+ inflightRequestsStorage = newValue
63+ }
64+ }
65+ }
5366
5467 @discardableResult
5568 func retrieveProductsInfo( _ productIds: Set < String > , completion: @escaping ( RetrieveResults ) -> Void ) -> InAppProductRequest {
You can’t perform that action at this time.
0 commit comments