From 869129b7bf4ecc57b97d0193ad29690ca2134750 Mon Sep 17 00:00:00 2001 From: "Aryan Singh K." <70511529+aryansk@users.noreply.github.com> Date: Fri, 14 Aug 2026 01:24:10 +0530 Subject: [PATCH] fix(MachPort): silence concurrency check for mach_task_self_ (#379) Darwin.Mach's mach_task_self_ is a shared global; Swift 6.3 reports it as not concurrency-safe when imported. Use a preconcurrency import for older Darwin SDKs. Fixes #373 Co-authored-by: Guillaume Lessard --- Sources/System/MachPort.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/System/MachPort.swift b/Sources/System/MachPort.swift index 124ab0d..c501c82 100644 --- a/Sources/System/MachPort.swift +++ b/Sources/System/MachPort.swift @@ -9,7 +9,11 @@ #if SYSTEM_PACKAGE_DARWIN +#if canImport(Darwin, _version: 310) import Darwin.Mach +#else +@preconcurrency import Darwin.Mach +#endif @available(System 1.4.0, *) public protocol MachPortRight {}