Skip to content

Commit

Permalink
Remove Sendable conformance from FileDescriptor, add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ffried committed Oct 27, 2022
1 parent f7938ab commit 97db554
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Sources/System/FileDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,13 @@ extension FileDescriptor.OpenOptions
}

#if compiler(>=5.5) && canImport(_Concurrency)
@available(*, unavailable, message: "FileDescriptors aren't safe to use across multiple threads.")
extension FileDescriptor: Sendable {}
// 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 {}

extension FileDescriptor.AccessMode: Sendable {}
extension FileDescriptor.OpenOptions: Sendable {}
extension FileDescriptor.SeekOrigin: Sendable {}
Expand Down

0 comments on commit 97db554

Please sign in to comment.