File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -645,6 +645,8 @@ extension Task where Success == Never, Failure == Never {
645
645
/// This is not a perfect cure for starvation;
646
646
/// if the task is the highest-priority task in the system, it might go
647
647
/// immediately back to executing.
648
+ ///
649
+ @available ( * , deprecated, renamed: " suspend() " )
648
650
public static func yield( ) async {
649
651
let currentTask = Builtin . getCurrentAsyncTask ( )
650
652
let priority = getJobFlags ( currentTask) . priority ?? Task . currentPriority. _downgradeUserInteractive
@@ -654,6 +656,11 @@ extension Task where Success == Never, Failure == Never {
654
656
_enqueueJobGlobal ( job)
655
657
}
656
658
}
659
+
660
+ @_alwaysEmitIntoClient
661
+ public static func suspend( ) async {
662
+ await yield ( )
663
+ }
657
664
}
658
665
659
666
// ==== UnsafeCurrentTask ------------------------------------------------------
You can’t perform that action at this time.
0 commit comments