Skip to content

Commit 5736201

Browse files
authored
Merge pull request #37496 from DougGregor/runTaskForBridgedAsyncMethod-older-compilers-5.5-05142021
[Concurrency] Provide an alternative implementation when "async { }" is unusable
2 parents 88b4523 + cfed6b2 commit 5736201

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,8 +1023,10 @@ func _getCurrentThreadPriority() -> Int
10231023
@_alwaysEmitIntoClient
10241024
@usableFromInline
10251025
internal func _runTaskForBridgedAsyncMethod(_ body: @escaping () async -> Void) {
1026-
#if compiler(>=5.5) && $Sendable
1026+
#if compiler(>=5.5) && $Sendable && $InheritActorContext && $ImplicitSelfCapture
10271027
async { await body() }
1028+
#else
1029+
detach { await body() }
10281030
#endif
10291031
}
10301032

0 commit comments

Comments
 (0)