From 5ff0aaabe00e13ed84e8826b43f7fc05c95dafe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Coye=20de=20Brune=CC=81lis?= Date: Wed, 31 Jan 2024 13:58:14 +0100 Subject: [PATCH] fix: Make sure a TolerantDispatchGroup has a default QoS that prevents most priority inversions --- .../InfomaniakCore/Asynchronous/TolerantDispatchGroup.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/InfomaniakCore/Asynchronous/TolerantDispatchGroup.swift b/Sources/InfomaniakCore/Asynchronous/TolerantDispatchGroup.swift index a1c3b31..8c588cc 100644 --- a/Sources/InfomaniakCore/Asynchronous/TolerantDispatchGroup.swift +++ b/Sources/InfomaniakCore/Asynchronous/TolerantDispatchGroup.swift @@ -24,7 +24,9 @@ public final class TolerantDispatchGroup { private let dispatchGroup = DispatchGroup() private var callBalancer = 0 - public init(qos: DispatchQoS = .default) { + /// Init method of TolerantDispatchGroup + /// - Parameter qos: The QoS of the underlying queue. Default to `.userInitiated` to prevent most priority inversions + public init(qos: DispatchQoS = .userInitiated) { syncQueue = DispatchQueue(label: "com.infomaniak.TolerantDispatchGroup", qos: qos) }