Skip to content

Commit b2e9620

Browse files
committed
[stdlib] Temporarily bring back Task.startSynchronously as deprecated
(cherry picked from commit 99d810a)
1 parent 2bf0007 commit b2e9620

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

stdlib/public/Concurrency/Task+immediate.swift.gyb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ import Swift
3232
@available(SwiftStdlib 6.2, *)
3333
extension Task where Failure == ${FAILURE_TYPE} {
3434

35+
@available(SwiftStdlib 6.2, *)
36+
@available(*, deprecated, renamed: "immediate")
37+
@discardableResult
38+
public static func startSynchronously(
39+
name: String? = nil,
40+
priority: TaskPriority? = nil,
41+
@_implicitSelfCapture _ operation: __owned @isolated(any) @escaping () async throws -> Success
42+
) -> Task<Success, ${FAILURE_TYPE}> {
43+
immediate(name: name, priority: priority, operation)
44+
}
45+
3546
/// Create and immediately start running a new task in the context of the calling thread/task.
3647
///
3748
/// This function _starts_ the created task on the calling context.

0 commit comments

Comments
 (0)