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.
1 parent 5ab2c36 commit a003496Copy full SHA for a003496
stdlib/public/Concurrency/Actor.cpp
@@ -1665,6 +1665,11 @@ retry:;
1665
1666
// Claim incoming jobs when obtaining lock as a drainer, to save one
1667
// round of atomic load and compare-exchange.
1668
+ // This is not useful when obtaining lock for assuming thread during actor
1669
+ // switching, because arbitrary use code can run between locking and
1670
+ // draining the next job. So we still need to call processIncomingQueue() to
1671
+ // check for higher priority jobs that could have been scheduled in the
1672
+ // meantime. And processing is more efficient when done in larger batches.
1673
if (asDrainer) {
1674
newState = newState.withFirstUnprioritisedJob(nullptr);
1675
}
0 commit comments