File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed
Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -44,31 +44,19 @@ class ProductsInfoController: NSObject {
4444 }
4545
4646 let inAppProductRequestBuilder : InAppProductRequestBuilder
47-
48- private var spinLock : OSSpinLock
49-
5047 init ( inAppProductRequestBuilder: InAppProductRequestBuilder = InAppProductQueryRequestBuilder ( ) ) {
5148 self . inAppProductRequestBuilder = inAppProductRequestBuilder
52- self . spinLock = OSSpinLock ( )
5349 }
5450
5551 // As we can have multiple inflight requests, we store them in a dictionary by product ids
5652 private var inflightRequests : [ Set < String > : InAppProductQuery ] = [ : ]
5753
5854 @discardableResult
5955 func retrieveProductsInfo( _ productIds: Set < String > , completion: @escaping ( RetrieveResults ) -> Void ) -> InAppProductRequest {
60- OSSpinLockLock ( & self . spinLock)
61- defer {
62- OSSpinLockUnlock ( & self . spinLock)
63- }
6456
6557 if inflightRequests [ productIds] == nil {
6658 let request = inAppProductRequestBuilder. request ( productIds: productIds) { results in
67- OSSpinLockLock ( & self . spinLock)
68- defer {
69- OSSpinLockUnlock ( & self . spinLock)
70- }
71-
59+
7260 if let query = self . inflightRequests [ productIds] {
7361 for completion in query. completionHandlers {
7462 completion ( results)
You can’t perform that action at this time.
0 commit comments