Prevent deadlocks by notifying group completion on background thread
This commit is contained in:
parent
d1c3d43018
commit
f193b6da1a
|
@ -456,11 +456,15 @@ extension CloudKitZone {
|
|||
}
|
||||
}
|
||||
|
||||
group.notify(queue: DispatchQueue.main) {
|
||||
group.notify(queue: DispatchQueue.global(qos: .background)) {
|
||||
if errorOccurred {
|
||||
completion(.failure(CloudKitZoneError.unknown))
|
||||
DispatchQueue.main.async {
|
||||
completion(.failure(CloudKitZoneError.unknown))
|
||||
}
|
||||
} else {
|
||||
completion(.success(()))
|
||||
DispatchQueue.main.async {
|
||||
completion(.success(()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue