diff options
author | agri <agri@yandex-team.ru> | 2022-02-10 16:48:12 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:12 +0300 |
commit | d3530b2692e400bd4d29bd4f07cafaee139164e7 (patch) | |
tree | b7ae636a74490e649a2ed0fdd5361f1bec83b9f9 /util/thread/lfqueue.h | |
parent | 0f4c5d1e8c0672bf0a1f2f2d8acac5ba24772435 (diff) | |
download | ydb-d3530b2692e400bd4d29bd4f07cafaee139164e7.tar.gz |
Restoring authorship annotation for <agri@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/thread/lfqueue.h')
-rw-r--r-- | util/thread/lfqueue.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/util/thread/lfqueue.h b/util/thread/lfqueue.h index ab523631e4..dcb1c0cd0a 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) { } |