Skip to content

Commit cba2779

Browse files
authored
TSCBasic: mark ThreadSafeOutputByteStream as Sendable (#387)
Since we still have to support Swift 5.5, this is marked as either `UnsafeSendable` or `@unchecked Sendable`, depending on the version of the Swift compiler.
1 parent 3350f6a commit cba2779

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/TSCBasic/WritableByteStream.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,13 @@ public final class ThreadSafeOutputByteStream: WritableByteStream {
348348
}
349349
}
350350

351+
352+
#if swift(<5.7)
353+
extension ThreadSafeOutputByteStream: UnsafeSendable {}
354+
#else
355+
extension ThreadSafeOutputByteStream: @unchecked Sendable {}
356+
#endif
357+
351358
/// Define an output stream operator. We need it to be left associative, so we
352359
/// use `<<<`.
353360
infix operator <<< : StreamingPrecedence

0 commit comments

Comments
 (0)