Skip to content

Commit

Permalink
Re-add Sendable conformance to FileDescriptor, adjust comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ffried committed Oct 27, 2022
1 parent 97db554 commit cf0ea93
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Sources/System/FileDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down

0 comments on commit cf0ea93

Please sign in to comment.