aboutsummaryrefslogtreecommitdiffstats
path: root/util/thread/lfstack.h
diff options
context:
space:
mode:
authorAlexander Gololobov <davenger@yandex-team.com>2022-02-10 16:47:37 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:37 +0300
commit39608cdb86363c75ce55b2b9a69841c3b71f22cf (patch)
tree4ec132c1665bd4d68e3628aa18d937c70d32413b /util/thread/lfstack.h
parent54295b9bd4dc45c54d804084fd846d945148a7f0 (diff)
downloadydb-39608cdb86363c75ce55b2b9a69841c3b71f22cf.tar.gz
Restoring authorship annotation for Alexander Gololobov <davenger@yandex-team.com>. Commit 1 of 2.
Diffstat (limited to 'util/thread/lfstack.h')
-rw-r--r--util/thread/lfstack.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/thread/lfstack.h b/util/thread/lfstack.h
index ca3d95f3c3..7a046e00b2 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;
}