From d4e697c0de106b9b9f407ce907dc9ab12d4fcb2e Mon Sep 17 00:00:00 2001 From: lwouis Date: Sat, 4 Jan 2025 13:28:20 +0100 Subject: [PATCH] docs: document why we don't see queue labels in instruments --- src/logic/BackgroundWork.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/logic/BackgroundWork.swift b/src/logic/BackgroundWork.swift index d0b03c60..e91e7aea 100644 --- a/src/logic/BackgroundWork.swift +++ b/src/logic/BackgroundWork.swift @@ -81,6 +81,9 @@ let backgroundWorkGlobalSemaphore = DispatchSemaphore(value: ProcessInfo.process extension DispatchQueue { static func globalConcurrent(_ label: String, _ qos: DispatchQoS) -> DispatchQueue { + // label is not reflected in Instruments because the target is .global + // if we want to see our custom labels, we need our private queue. + // However, we want to be efficient and use the OS thread pool, so we use .global DispatchQueue(label: label, attributes: .concurrent, target: .global(qos: qos.qosClass)) }