Skip to content

Commit cf0ea93

Browse files
committed
Re-add Sendable conformance to FileDescriptor, adjust comment
1 parent 97db554 commit cf0ea93

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Sources/System/FileDescriptor.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,10 @@ extension FileDescriptor.OpenOptions
476476

477477
#if compiler(>=5.5) && canImport(_Concurrency)
478478
// File descriptors aren't necessarily safe to use across threads.
479-
// Thus no explicit `Sendable` conformance.
480-
// They can be used in a safe way, however,
481-
// which is why the conformance cannot be marked with `@available(*, unavailable)`.
482-
483-
// extension FileDescriptor: Sendable {}
484-
479+
// However, since they can be used in a safe way,
480+
// we do make them `Sendable` to not make it unnecessarily complicated to
481+
// use them across concurrency boundaries in a safe way.
482+
extension FileDescriptor: Sendable {}
485483
extension FileDescriptor.AccessMode: Sendable {}
486484
extension FileDescriptor.OpenOptions: Sendable {}
487485
extension FileDescriptor.SeekOrigin: Sendable {}

0 commit comments

Comments
 (0)