Skip to content

Commit baf827f

Browse files
committed
Restore compare_exchange_weak in two cases where it should be ok
1 parent 01c4f45 commit baf827f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/DWARFLinker/Parallel/ArrayList.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ template <typename T, size_t ItemsGroupSize = 512> class ArrayList {
4949
if (!CurGroup->Next)
5050
allocateNewGroup(CurGroup->Next);
5151

52-
LastGroup.compare_exchange_strong(CurGroup, CurGroup->Next);
52+
LastGroup.compare_exchange_weak(CurGroup, CurGroup->Next);
5353
} while (true);
5454

5555
// Store item into the current group.
@@ -145,7 +145,7 @@ template <typename T, size_t ItemsGroupSize = 512> class ArrayList {
145145
ItemsGroup *NextGroup = CurGroup->Next;
146146

147147
if (!NextGroup) {
148-
if (CurGroup->Next.compare_exchange_strong(NextGroup, NewGroup))
148+
if (CurGroup->Next.compare_exchange_weak(NextGroup, NewGroup))
149149
break;
150150
}
151151

0 commit comments

Comments
 (0)