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 *
10311031preprocessQueue (JobRef unprocessedStart, JobRef unprocessedEnd, Job *existingProcessedJobsToMergeInto)
10321032{
10331033 assert (existingProcessedJobsToMergeInto != NULL );
1034+ assert (unprocessedStart.needsPreprocessing ());
1035+ assert (unprocessedStart.getAsJob () != unprocessedEnd.getAsJob ());
10341036
10351037 // Build up a list of jobs we need to preprocess
10361038 using ListMerger = swift::ListMerger<Job*, JobQueueTraits>;
@@ -1423,6 +1425,11 @@ Job * DefaultActorImpl::drainOne() {
14231425 return firstJob;
14241426 }
14251427
1428+ // We failed the weak cmpxchg spuriously, go through loop again.
1429+ if (oldState.getFirstJob ().getAsJob () == jobToPreprocessFrom.getAsJob ()) {
1430+ continue ;
1431+ }
1432+
14261433 // There were new items concurrently added to the queue. We need to
14271434 // preprocess the newly added unprocessed items and merge them to the already
14281435 // preprocessed list.
You can’t perform that action at this time.
0 commit comments