Skip to content

Commit c831568

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

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
@@ -698,7 +698,7 @@ public struct UnsafeCurrentTask {
698698
/// Returns `true` if the task is cancelled, and should stop executing.
699699
///
700700
/// - SeeAlso: `checkCancellation()`
701-
public var isCancelled: Bool {
701+
@_transparent public var isCancelled: Bool {
702702
_taskIsCancelled(_task)
703703
}
704704

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

797797
@available(SwiftStdlib 5.5, *)
798798
@_silgen_name("swift_task_isCancelled")
799+
@usableFromInline
799800
func _taskIsCancelled(_ task: Builtin.NativeObject) -> Bool
800801

801802
@available(SwiftStdlib 5.5, *)

stdlib/public/Concurrency/TaskCancellation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extension Task {
4545
/// Returns `true` if the task is cancelled, and should stop executing.
4646
///
4747
/// - SeeAlso: `checkCancellation()`
48-
public var isCancelled: Bool {
48+
@_transparent public var isCancelled: Bool {
4949
_taskIsCancelled(_task)
5050
}
5151
}

0 commit comments

Comments
 (0)