Skip to content

Commit 271d92f

Browse files
committed
[Concurrency] Switch _runTaskForBridgedAsyncMethod over to using 'async'
(cherry picked from commit ace5f49)
1 parent 9d697a5 commit 271d92f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -854,12 +854,8 @@ func _getCurrentThreadPriority() -> Int
854854
@_alwaysEmitIntoClient
855855
@usableFromInline
856856
internal func _runTaskForBridgedAsyncMethod(_ body: @escaping () async -> Void) {
857-
// TODO: We can probably do better than detach
858-
// if we're already running on behalf of a task,
859-
// if the receiver of the method invocation is itself an Actor, or in other
860-
// situations.
861857
#if compiler(>=5.5) && $Sendable
862-
detach { await body() }
858+
async { await body() }
863859
#endif
864860
}
865861

0 commit comments

Comments
 (0)