We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 374554b + 250081e commit bfd4ef6Copy full SHA for bfd4ef6
Sources/SwiftExtensions/Task+WithPriorityChangedHandler.swift
@@ -29,10 +29,7 @@ package func withTaskPriorityChangedHandler<T: Sendable>(
29
// want to make sure that we don't leave the body task or the priority watching task running.
30
taskGroup.cancelAll()
31
}
32
- // Run the task priority watcher with high priority instead of inheriting the initial priority. Otherwise a
33
- // `.background` task might not get its priority elevated because the priority watching task also runs at
34
- // `.background` priority and might not actually get executed in time.
35
- taskGroup.addTask(priority: .high) {
+ taskGroup.addTask(priority: initialPriority) {
36
while true {
37
if Task.isCancelled {
38
break
0 commit comments