Skip to content

Commit fa40675

Browse files
Further workaround for priority mishandling in runtime.
See rdar://79378762, SR-14802, SR-14841, SR-14875. This doesn't resolve all hangs, such as those occurring due to explicit usage of priorities and certain other situations where priorities seem to be causing issues (rdar://79823345), but it does resolve some cases.
1 parent b2ca238 commit fa40675

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

stdlib/public/Concurrency/Task.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,12 @@ static AsyncTaskAndContext swift_task_create_commonImpl(
476476
if (currentTask)
477477
jobFlags.setPriority(currentTask->getPriority());
478478
else
479-
jobFlags.setPriority(swift_task_getCurrentThreadPriority());
479+
// FIXME: Ideally, this should be setting priority based on
480+
// swift_task_getCurrentThreadPriority(). However, that creates
481+
// priority differences which lead to different kinds of hangs
482+
// Temporarily use Unspecified to work around that.
483+
// See also: PR #37939.
484+
jobFlags.setPriority(JobPriority::Unspecified);
480485
}
481486

482487
// Figure out the size of the header.

0 commit comments

Comments
 (0)