summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2022-07-27 13:26:50 +0200
committerAndrej Mihajlov <and@mullvad.net>2022-07-27 14:37:12 +0200
commit16873ae313c62c15d768c8062571bccf5875d907 (patch)
tree27c7bc8824e57a4d917b251f4341c555e5e41a4e
parent0e68472763a24335c972f7c386d6fdc002118747 (diff)
downloadmullvadvpn-16873ae313c62c15d768c8062571bccf5875d907.tar.xz
mullvadvpn-16873ae313c62c15d768c8062571bccf5875d907.zip
AsyncOperation: refactor checkReadiness()
-rw-r--r--ios/MullvadVPN/Operations/AsyncOperation.swift3
1 files changed, 1 insertions, 2 deletions
diff --git a/ios/MullvadVPN/Operations/AsyncOperation.swift b/ios/MullvadVPN/Operations/AsyncOperation.swift
index 725c062a67..1655098af6 100644
--- a/ios/MullvadVPN/Operations/AsyncOperation.swift
+++ b/ios/MullvadVPN/Operations/AsyncOperation.swift
@@ -371,12 +371,11 @@ class AsyncOperation: Operation {
private func checkReadiness() {
operationLock.lock()
+ defer { operationLock.unlock() }
if state == .pending, !_isCancelled, super.isReady {
evaluateConditions()
}
-
- operationLock.unlock()
}
private func tryFinish(error: Error?) -> Bool {