Skip to content

Commit

Permalink
Add Sendable conformance to FileDescriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
ffried committed Jul 10, 2023
1 parent 0062c82 commit dd086a0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Sources/System/FileDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,11 @@ extension FileDescriptor.OpenOptions
}

#if compiler(>=5.5) && canImport(_Concurrency)
// The decision on whether to make FileDescriptor Sendable or not
// is currently being discussed in https://github.com/apple/swift-system/pull/112
//@available(*, unavailable, message: "File descriptors are not completely thread-safe.")
//extension FileDescriptor: Sendable {}
// File descriptors aren't necessarily safe to use across threads.
// 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 {}

@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
extension FileDescriptor.AccessMode: Sendable {}
Expand Down

0 comments on commit dd086a0

Please sign in to comment.