Skip to content

Commit 6edfdda

Browse files
authored
Merge pull request swiftlang#38599 from DougGregor/task-yield-5.5
2 parents d3429d1 + d6786ff commit 6edfdda

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

stdlib/public/Concurrency/SourceCompatibilityShims.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ extension Task where Success == Never, Failure == Never {
2929
public static func CancellationError() -> _Concurrency.CancellationError {
3030
return _Concurrency.CancellationError()
3131
}
32+
33+
@available(*, deprecated, renamed: "yield()")
34+
@_alwaysEmitIntoClient
35+
public static func suspend() async {
36+
await yield()
37+
}
3238
}
3339

3440
@available(SwiftStdlib 5.5, *)

stdlib/public/Concurrency/Task.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,6 @@ extension Task where Success == Never, Failure == Never {
658658
/// the executor immediately resumes execution of the same task.
659659
/// As such,
660660
/// this method isn't necessarily a way to avoid resource starvation.
661-
@available(*, deprecated, renamed: "suspend()")
662661
public static func yield() async {
663662
let currentTask = Builtin.getCurrentAsyncTask()
664663
let priority = getJobFlags(currentTask).priority ?? Task.currentPriority._downgradeUserInteractive
@@ -668,11 +667,6 @@ extension Task where Success == Never, Failure == Never {
668667
_enqueueJobGlobal(job)
669668
}
670669
}
671-
672-
@_alwaysEmitIntoClient
673-
public static func suspend() async {
674-
await yield()
675-
}
676670
}
677671

678672
// ==== UnsafeCurrentTask ------------------------------------------------------

0 commit comments

Comments
 (0)