File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -475,10 +475,11 @@ extension FileDescriptor.OpenOptions
475
475
}
476
476
477
477
#if compiler(>=5.5) && canImport(_Concurrency)
478
- // File descriptors aren't necessarily safe to use across threads.
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.
478
+ // Since some file descriptor operations aren't safe to use across threads,
479
+ // we mark the Sendable conformance as unavailble.
480
+ // To use file descriptors with operations that *are* thread-safe,
481
+ // wrap them in an `@unchecked Sendable` type.
482
+ @available ( * , unavailable, message: " File descriptors are not completely thread-safe. " )
482
483
extension FileDescriptor : Sendable { }
483
484
484
485
extension FileDescriptor . AccessMode : Sendable { }
You can’t perform that action at this time.
0 commit comments