Skip to content

Commit 272a1c2

Browse files
committed
Make sure that Task.isCancelled fix works on older OSs.
Part of rdar://84146091 & SR-15309.
1 parent aa75c4e commit 272a1c2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ public struct UnsafeCurrentTask {
754754
/// There is no way to uncancel a task.
755755
///
756756
/// - SeeAlso: `checkCancellation()`
757-
public var isCancelled: Bool {
757+
@_transparent public var isCancelled: Bool {
758758
_taskIsCancelled(_task)
759759
}
760760

@@ -860,6 +860,7 @@ func _taskCancel(_ task: Builtin.NativeObject)
860860

861861
@available(SwiftStdlib 5.5, *)
862862
@_silgen_name("swift_task_isCancelled")
863+
@usableFromInline
863864
func _taskIsCancelled(_ task: Builtin.NativeObject) -> Bool
864865

865866
@available(SwiftStdlib 5.5, *)

stdlib/public/Concurrency/TaskCancellation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extension Task {
5050
/// There is no way to uncancel a task.
5151
///
5252
/// - SeeAlso: `checkCancellation()`
53-
public var isCancelled: Bool {
53+
@_transparent public var isCancelled: Bool {
5454
_taskIsCancelled(_task)
5555
}
5656
}

0 commit comments

Comments
 (0)