From cf0ea93843db24a33895634e52200520350a2eae Mon Sep 17 00:00:00 2001 From: Florian Friedrich Date: Thu, 27 Oct 2022 07:41:26 +0200 Subject: [PATCH] Re-add Sendable conformance to FileDescriptor, adjust comment --- Sources/System/FileDescriptor.swift | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Sources/System/FileDescriptor.swift b/Sources/System/FileDescriptor.swift index 81a45e88..7fa6eb18 100644 --- a/Sources/System/FileDescriptor.swift +++ b/Sources/System/FileDescriptor.swift @@ -476,12 +476,10 @@ extension FileDescriptor.OpenOptions #if compiler(>=5.5) && canImport(_Concurrency) // File descriptors aren't necessarily safe to use across threads. -// Thus no explicit `Sendable` conformance. -// They can be used in a safe way, however, -// which is why the conformance cannot be marked with `@available(*, unavailable)`. - -// extension FileDescriptor: Sendable {} - +// However, since they can be used in a safe way, +// we do make them `Sendable` to not make it unnecessarily complicated to +// use them across concurrency boundaries in a safe way. +extension FileDescriptor: Sendable {} extension FileDescriptor.AccessMode: Sendable {} extension FileDescriptor.OpenOptions: Sendable {} extension FileDescriptor.SeekOrigin: Sendable {}