You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: stdlib/public/Concurrency/Task.swift
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ extension Task {
50
50
/// this function was called.
51
51
///
52
52
/// All functions available on the Task
53
+
@available(*, deprecated, message:"`Task.current` has been deprecated and will be removed, use static functions on Task instead.")
53
54
publicstaticvarcurrent:Task?{
54
55
guardlet _task =_getCurrentAsyncTask()else{
55
56
returnnil
@@ -88,6 +89,7 @@ extension Task {
88
89
///
89
90
/// - SeeAlso: `Task.Priority`
90
91
/// - SeeAlso: `Task.currentPriority`
92
+
@available(*, deprecated, message:"Storing `Task` instances has been deprecated, and as such instance functions on Task are deprecated and will be removed soon. Use the static 'Task.currentPriority' instead.")
91
93
publicvarpriority:Priority{
92
94
getJobFlags(_task).priority
93
95
}
@@ -158,6 +160,7 @@ extension Task {
158
160
}
159
161
160
162
/// Returns the `Task` that this handle refers to.
163
+
@available(*, deprecated, message:"Storing `Task` instances has been deprecated and will be removed soon.")
161
164
publicvartask:Task{
162
165
Task(_task)
163
166
}
@@ -671,6 +674,7 @@ public struct UnsafeCurrentTask {
671
674
///
672
675
/// Operations on `Task` (unlike `UnsafeCurrentTask`) are safe to be called
673
676
/// from any other task (or thread).
677
+
@available(*, deprecated, message:"Storing `Task` instances has been deprecated and will be removed soon.")
0 commit comments