aboutsummaryrefslogtreecommitdiffstats
path: root/util/thread/lfqueue.h
diff options
context:
space:
mode:
authoragri <agri@yandex-team.ru>2022-02-10 16:48:12 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:12 +0300
commit2909866fbc652492b7d7cab3023cb19489dc4fd8 (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /util/thread/lfqueue.h
parentd3530b2692e400bd4d29bd4f07cafaee139164e7 (diff)
downloadydb-2909866fbc652492b7d7cab3023cb19489dc4fd8.tar.gz
Restoring authorship annotation for <agri@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/thread/lfqueue.h')
-rw-r--r--util/thread/lfqueue.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/util/thread/lfqueue.h b/util/thread/lfqueue.h
index dcb1c0cd0a..ab523631e4 100644
--- a/util/thread/lfqueue.h
+++ b/util/thread/lfqueue.h
@@ -76,16 +76,16 @@ class TLockFreeQueue: public TNonCopyable {
alignas(64) TRootNode* volatile FreePtr;
void TryToFreeAsyncMemory() {
- TAtomic keepCounter = AtomicAdd(FreeingTaskCounter, 0);
+ TAtomic keepCounter = AtomicAdd(FreeingTaskCounter, 0);
TRootNode* current = AtomicGet(FreePtr);
if (current == nullptr)
return;
if (AtomicAdd(FreememCounter, 0) == 1) {
// we are the last thread, try to cleanup
- // check if another thread have cleaned up
- if (keepCounter != AtomicAdd(FreeingTaskCounter, 0)) {
- return;
- }
+ // check if another thread have cleaned up
+ if (keepCounter != AtomicAdd(FreeingTaskCounter, 0)) {
+ return;
+ }
if (AtomicCas(&FreePtr, (TRootNode*)nullptr, current)) {
// free list
while (current) {
@@ -94,7 +94,7 @@ class TLockFreeQueue: public TNonCopyable {
delete current;
current = p;
}
- AtomicAdd(FreeingTaskCounter, 1);
+ AtomicAdd(FreeingTaskCounter, 1);
}
}
}
@@ -228,7 +228,7 @@ public:
TLockFreeQueue()
: JobQueue(new TRootNode)
, FreememCounter(0)
- , FreeingTaskCounter(0)
+ , FreeingTaskCounter(0)
, FreePtr(nullptr)
{
}