diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2022-02-04 11:06:16 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2022-02-07 14:37:41 +0100 |
| commit | e5de907c511a0a3c8df01ccb9cbd9b4b126ec05f (patch) | |
| tree | 465aa930fb97b3ff473a27d271f992623fb26c27 | |
| parent | 17e82ec44771349e453e9e1cc0e77b6b0b01635f (diff) | |
| download | mullvadvpn-e5de907c511a0a3c8df01ccb9cbd9b4b126ec05f.tar.xz mullvadvpn-e5de907c511a0a3c8df01ccb9cbd9b4b126ec05f.zip | |
Operation: add extension to set multiple dependencies at once
| -rw-r--r-- | ios/MullvadVPN/Operations/AsyncOperation.swift | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ios/MullvadVPN/Operations/AsyncOperation.swift b/ios/MullvadVPN/Operations/AsyncOperation.swift index 9936108e58..c4f628434d 100644 --- a/ios/MullvadVPN/Operations/AsyncOperation.swift +++ b/ios/MullvadVPN/Operations/AsyncOperation.swift @@ -10,7 +10,6 @@ import Foundation /// A base implementation of an asynchronous operation class AsyncOperation: Operation { - /// A state lock used for manipulating the operation state flags in a thread safe fashion. private let stateLock = NSRecursiveLock() @@ -87,3 +86,11 @@ class AsyncOperation: Operation { didChangeValue(for: \.isExecuting) } } + +extension Operation { + func addDependencies(_ dependencies: [Operation]) { + for dependency in dependencies { + addDependency(dependency) + } + } +} |
