Skip to content

[Concurrency] Remove deprecated Task.startSynchronously API #83342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions stdlib/public/Concurrency/Task+immediate.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,6 @@ import Swift
% THROWS = ''
% end

@available(SwiftStdlib 6.2, *)
extension Task where Failure == ${FAILURE_TYPE} {

@available(SwiftStdlib 6.2, *)
@available(*, deprecated, message: "Deprecated spelling of Task.immediate. This method will be removed.")
@discardableResult
@_alwaysEmitIntoClient // moved to AEIC in order to eventually remove this function.
public static func startSynchronously(
name: String? = nil,
priority: TaskPriority? = nil,
@_implicitSelfCapture @_inheritActorContext(always) _ operation: sending @isolated(any) @escaping () async ${THROWS} -> Success
) -> Task<Success, ${FAILURE_TYPE}> {
immediate(name: name, priority: priority, operation: operation)
}
}

% end

// ==== Task.immediate(Detached) ---------------------------------------------------------
Expand Down
10 changes: 2 additions & 8 deletions test/Concurrency/Runtime/startImmediately.swift
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,6 @@ print("call_taskImmediate_insideActor()")

actor A {
func f() {
Task.startSynchronously(name: "hello") { print("Task.startSynchronously (\(Task.name!))") }
Task.startSynchronously() { print("Task.startSynchronously") }
}

func f2() {
Task.immediate(name: "hello") { print("Task.immediate (\(Task.name!))") }
Task.immediate() { print("Task.immediate") }

Expand All @@ -449,11 +444,10 @@ actor A {
}
}

func call_startSynchronously_insideActor() async {
func call_immediate_insideActor() async {
await A().f()
await A().f2()
}
await call_startSynchronously_insideActor()
await call_immediate_insideActor()


print("\n\n==== ------------------------------------------------------------------")
Expand Down