Skip to content

Commit cd30a00

Browse files
committed
Move priority adjustments for async task creation into the runtime.
We're not actually performing the adjustments at the moment due to an unrelated bug, and will want to perform them within `swift_task_create_common` based on inheritContext and the given priority.
1 parent b0237c6 commit cd30a00

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ extension Task where Failure == Never {
541541
#if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
542542
// Set up the job flags for a new task.
543543
var flags = TaskCreateFlags()
544-
flags.priority = priority ?? Task<Never, Never>.currentPriority._downgradeUserInteractive
544+
flags.priority = priority
545545
flags.inheritContext = true
546546
flags.copyTaskLocals = true
547547
flags.enqueueJob = true
@@ -578,7 +578,7 @@ extension Task where Failure == Error {
578578
#if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
579579
// Set up the job flags for a new task.
580580
var flags = TaskCreateFlags()
581-
flags.priority = priority ?? Task<Never, Never>.currentPriority._downgradeUserInteractive
581+
flags.priority = priority
582582
flags.inheritContext = true
583583
flags.copyTaskLocals = true
584584
flags.enqueueJob = true
@@ -634,7 +634,7 @@ extension Task where Failure == Never {
634634
#if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
635635
// Set up the job flags for a new task.
636636
var flags = TaskCreateFlags()
637-
flags.priority = priority ?? .unspecified
637+
flags.priority = priority
638638
flags.enqueueJob = true
639639

640640
// Create the asynchronous task future.
@@ -689,7 +689,7 @@ extension Task where Failure == Error {
689689
#if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
690690
// Set up the job flags for a new task.
691691
var flags = TaskCreateFlags()
692-
flags.priority = priority ?? .unspecified
692+
flags.priority = priority
693693
flags.enqueueJob = true
694694

695695
// Create the asynchronous task future.

0 commit comments

Comments
 (0)