Skip to content

Commit

Permalink
Further workaround for priority mishandling in runtime.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
varungandhi-apple committed Jul 16, 2021
1 parent b2ca238 commit fa40675
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion stdlib/public/Concurrency/Task.cpp
Expand Up @@ -476,7 +476,12 @@ static AsyncTaskAndContext swift_task_create_commonImpl(
if (currentTask)
jobFlags.setPriority(currentTask->getPriority());
else
jobFlags.setPriority(swift_task_getCurrentThreadPriority());
// FIXME: Ideally, this should be setting priority based on
// swift_task_getCurrentThreadPriority(). However, that creates
// priority differences which lead to different kinds of hangs
// Temporarily use Unspecified to work around that.
// See also: PR #37939.
jobFlags.setPriority(JobPriority::Unspecified);
}

// Figure out the size of the header.
Expand Down

0 comments on commit fa40675

Please sign in to comment.