mirror of
https://github.com/apple/swift-nio
synced 2026-11-29 05:24:21 +00:00
EventLoopFuture/Promise: only Sendable if Value is Sendable (#2496)
Co-authored-by: Cory Benfield <lukasa@apple.com>
This commit is contained in:
1 parent
cf281631ff
commit
ac695eb00f
1 file changed
+4
-4
@@ -2293,13 +2293,13 @@ public struct _NIOEventLoopFutureIdentifier: Hashable, Sendable {
|
||||
}
|
||||
}
|
||||
|
||||
// EventLoopPromise is a reference type, but by its very nature is Sendable.
|
||||
extension EventLoopPromise: Sendable { }
|
||||
// EventLoopPromise is a reference type, but by its very nature is Sendable (if its Value is).
|
||||
extension EventLoopPromise: Sendable where Value: Sendable { }
|
||||
|
||||
// EventLoopFuture is a reference type, but it is Sendable. However, we enforce
|
||||
// EventLoopFuture is a reference type, but it is Sendable (if its Value is). However, we enforce
|
||||
// that by way of the guarantees of the EventLoop protocol, so the compiler cannot
|
||||
// check it.
|
||||
extension EventLoopFuture: @unchecked Sendable { }
|
||||
extension EventLoopFuture: @unchecked Sendable where Value: Sendable { }
|
||||
|
||||
extension EventLoopPromise where Value == Void {
|
||||
// Deliver a successful result to the associated `EventLoopFuture<Void>` object.
|
||||
|
||||
Reference in new issue
Block a user