diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2023-01-17 15:26:52 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2023-01-17 15:26:52 +0100 |
| commit | 76b3ccd8ce4d8295b7b6b7e4ef7ee8b89bc047fc (patch) | |
| tree | 6507caa21f74a386b5319dd81fdfea072aed4f0a /ios/Operations | |
| parent | f9defadab69084965dcc9c4f9fd194dde250cce4 (diff) | |
| parent | 64e254bad6becaf30cd53ec24fb9984942b9bcfa (diff) | |
| download | mullvadvpn-76b3ccd8ce4d8295b7b6b7e4ef7ee8b89bc047fc.tar.xz mullvadvpn-76b3ccd8ce4d8295b7b6b7e4ef7ee8b89bc047fc.zip | |
Merge branch 'serial-op-queue-helper'
Diffstat (limited to 'ios/Operations')
| -rw-r--r-- | ios/Operations/AsyncOperationQueue.swift | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ios/Operations/AsyncOperationQueue.swift b/ios/Operations/AsyncOperationQueue.swift index f454340a45..4579546084 100644 --- a/ios/Operations/AsyncOperationQueue.swift +++ b/ios/Operations/AsyncOperationQueue.swift @@ -8,7 +8,7 @@ import Foundation -public class AsyncOperationQueue: OperationQueue { +public final class AsyncOperationQueue: OperationQueue { override public func addOperation(_ operation: Operation) { if let operation = operation as? AsyncOperation { let categories = operation.conditions @@ -42,6 +42,12 @@ public class AsyncOperationQueue: OperationQueue { } } } + + public static func makeSerial() -> AsyncOperationQueue { + let queue = AsyncOperationQueue() + queue.maxConcurrentOperationCount = 1 + return queue + } } private final class ExclusivityManager { |
