File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -264,12 +264,12 @@ static bool isExecutingOnMainThread() {
264264}
265265
266266JobPriority swift::swift_task_getCurrentThreadPriority () {
267- if (isExecutingOnMainThread ())
268- return JobPriority::UserInitiated;
269-
270267#if defined(__APPLE__)
271268 return static_cast <JobPriority>(qos_class_self ());
272269#else
270+ if (isExecutingOnMainThread ())
271+ return JobPriority::UserInitiated;
272+
273273 return JobPriority::Unspecified;
274274#endif
275275}
Original file line number Diff line number Diff line change @@ -493,6 +493,10 @@ public func async(
493493 actualPriority = priority
494494 }
495495
496+ let adjustedPriority = actualPriority == . userInteractive
497+ ? . userInitiated
498+ : actualPriority
499+
496500 // Set up the job flags for a new task.
497501 var flags = Task . JobFlags ( )
498502 flags. kind = . task
You can’t perform that action at this time.
0 commit comments