File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1031,6 +1031,8 @@ static Job *
1031
1031
preprocessQueue (JobRef unprocessedStart, JobRef unprocessedEnd, Job *existingProcessedJobsToMergeInto)
1032
1032
{
1033
1033
assert (existingProcessedJobsToMergeInto != NULL );
1034
+ assert (unprocessedStart.needsPreprocessing ());
1035
+ assert (unprocessedStart.getAsJob () != unprocessedEnd.getAsJob ());
1034
1036
1035
1037
// Build up a list of jobs we need to preprocess
1036
1038
using ListMerger = swift::ListMerger<Job*, JobQueueTraits>;
@@ -1423,6 +1425,11 @@ Job * DefaultActorImpl::drainOne() {
1423
1425
return firstJob;
1424
1426
}
1425
1427
1428
+ // We failed the weak cmpxchg spuriously, go through loop again.
1429
+ if (oldState.getFirstJob ().getAsJob () == jobToPreprocessFrom.getAsJob ()) {
1430
+ continue ;
1431
+ }
1432
+
1426
1433
// There were new items concurrently added to the queue. We need to
1427
1434
// preprocess the newly added unprocessed items and merge them to the already
1428
1435
// preprocessed list.
You can’t perform that action at this time.
0 commit comments