Skip to content

Commit da1f8b2

Browse files
authored
Merge pull request #83342 from xedin/remove-startSynchronously
[Concurrency] Remove deprecated `Task.startSynchronously` API
2 parents c13957a + 95d4ef5 commit da1f8b2

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,6 @@ import Swift
3030
% THROWS = ''
3131
% end
3232

33-
@available(SwiftStdlib 6.2, *)
34-
extension Task where Failure == ${FAILURE_TYPE} {
35-
36-
@available(SwiftStdlib 6.2, *)
37-
@available(*, deprecated, message: "Deprecated spelling of Task.immediate. This method will be removed.")
38-
@discardableResult
39-
@_alwaysEmitIntoClient // moved to AEIC in order to eventually remove this function.
40-
public static func startSynchronously(
41-
name: String? = nil,
42-
priority: TaskPriority? = nil,
43-
@_implicitSelfCapture @_inheritActorContext(always) _ operation: sending @isolated(any) @escaping () async ${THROWS} -> Success
44-
) -> Task<Success, ${FAILURE_TYPE}> {
45-
immediate(name: name, priority: priority, operation: operation)
46-
}
47-
}
48-
4933
% end
5034

5135
// ==== Task.immediate(Detached) ---------------------------------------------------------

test/Concurrency/Runtime/startImmediately.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -436,11 +436,6 @@ print("call_taskImmediate_insideActor()")
436436

437437
actor A {
438438
func f() {
439-
Task.startSynchronously(name: "hello") { print("Task.startSynchronously (\(Task.name!))") }
440-
Task.startSynchronously() { print("Task.startSynchronously") }
441-
}
442-
443-
func f2() {
444439
Task.immediate(name: "hello") { print("Task.immediate (\(Task.name!))") }
445440
Task.immediate() { print("Task.immediate") }
446441

@@ -449,11 +444,10 @@ actor A {
449444
}
450445
}
451446

452-
func call_startSynchronously_insideActor() async {
447+
func call_immediate_insideActor() async {
453448
await A().f()
454-
await A().f2()
455449
}
456-
await call_startSynchronously_insideActor()
450+
await call_immediate_insideActor()
457451

458452

459453
print("\n\n==== ------------------------------------------------------------------")

0 commit comments

Comments
 (0)