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 <guillaume.lessard@apple.com>
This commit is contained in:
Aryan Singh K.andGuillaume Lessard authored and GitHub committed 2026-08-13 12:54:10 -07:00
1 parent 5c2854d7bd
commit 869129b7bf
1 file changed
+4
+4
View File
@@ -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 {}