diff options
author | Alexander Gololobov <[email protected]> | 2022-02-10 16:47:38 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:47:38 +0300 |
commit | fccc62e9bfdce9be2fe7e0f23479da3a5512211a (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /util/thread/lfstack.h | |
parent | 39608cdb86363c75ce55b2b9a69841c3b71f22cf (diff) |
Restoring authorship annotation for Alexander Gololobov <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/thread/lfstack.h')
-rw-r--r-- | util/thread/lfstack.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util/thread/lfstack.h b/util/thread/lfstack.h index 7a046e00b27..ca3d95f3c39 100644 --- a/util/thread/lfstack.h +++ b/util/thread/lfstack.h @@ -98,7 +98,7 @@ public: bool Dequeue(T* res) { AtomicAdd(DequeueCount, 1); for (TNode* current = AtomicGet(Head); current; current = AtomicGet(Head)) { - if (AtomicCas(&Head, AtomicGet(current->Next), current)) { + if (AtomicCas(&Head, AtomicGet(current->Next), current)) { *res = std::move(current->Value); // delete current; // ABA problem // even more complex node deletion @@ -109,7 +109,7 @@ public: } else { // Dequeue()s in progress, put node to free list for (;;) { - AtomicSet(current->Next, AtomicGet(FreePtr)); + AtomicSet(current->Next, AtomicGet(FreePtr)); if (AtomicCas(&FreePtr, current, current->Next)) break; } @@ -145,7 +145,7 @@ public: currentLast = currentLast->Next; } for (;;) { - AtomicSet(currentLast->Next, AtomicGet(FreePtr)); + AtomicSet(currentLast->Next, AtomicGet(FreePtr)); if (AtomicCas(&FreePtr, current, currentLast->Next)) break; } |