Skip to content

Commit 56ac85a

Browse files
committed
Fix async_task_priority_current priority escalation
The priority escalation doesn't work quite as I thought it did. It isn't whichever is greater, the priority of the task or the priority of the place awaiting the result of the task. It seems to be less reliable than that. I've changed the test accept either a default priority or that of the main thread.
1 parent 915a521 commit 56ac85a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/Concurrency/Runtime/async_task_priority_current.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ func test_detach() async {
4242
await detach(priority: .default) {
4343
let a3 = Task.currentPriority
4444
// The priority of 'a3' may either be 21 (default) or elevated to that of
45-
// the main function, whichever is greater.
46-
print("a3: \(a3)") // CHECK: a3: TaskPriority(rawValue: [[#max(MAIN_PRIORITY,21)]]
45+
// the main function.
46+
print("a3: \(a3)") // CHECK: a3: TaskPriority(rawValue: {{21|[[#MAIN_PRIORITY]]}})
4747
}.get()
4848

4949
let a4 = Task.currentPriority

0 commit comments

Comments
 (0)