Atomically get the next node (sanitizer warning)
@@ -194,7 +194,7 @@ class TLockFreeQueue: public TNonCopyable {
static void FillCollection(TListNode* lst, TCollection* res) {
while (lst) {
res->emplace_back(std::move(lst->Data));
- lst = lst->Next;
+ lst = AtomicGet(lst->Next);
}
}
@@ -211,7 +211,7 @@ class TLockFreeQueue: public TNonCopyable {
do {
TListNode* newElem = new TListNode(std::move(lst->Data), newCopy);
newCopy = newElem;
- lst = lst->Next;
+ lst = AtomicGet(lst->Next);
} while (lst);
FillCollection(newCopy, res);
