aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/equeue/equeue.h
diff options
context:
space:
mode:
authorkulikov <kulikov@yandex-team.ru>2022-02-10 16:49:34 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:34 +0300
commitc707901605d7b7c6cba0998cd52e1ae619c97762 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/threading/equeue/equeue.h
parent65e5266709e7ff94b14ae128309e229de714b0df (diff)
downloadydb-c707901605d7b7c6cba0998cd52e1ae619c97762.tar.gz
Restoring authorship annotation for <kulikov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/threading/equeue/equeue.h')
-rw-r--r--library/cpp/threading/equeue/equeue.h50
1 files changed, 25 insertions, 25 deletions
diff --git a/library/cpp/threading/equeue/equeue.h b/library/cpp/threading/equeue/equeue.h
index 403e993713..40dd342585 100644
--- a/library/cpp/threading/equeue/equeue.h
+++ b/library/cpp/threading/equeue/equeue.h
@@ -1,28 +1,28 @@
-#pragma once
-
+#pragma once
+
#include <util/thread/pool.h>
-#include <util/system/atomic.h>
-#include <util/generic/ptr.h>
-
-//actual queue limit will be (maxQueueSize - numBusyThreads) or 0
+#include <util/system/atomic.h>
+#include <util/generic/ptr.h>
+
+//actual queue limit will be (maxQueueSize - numBusyThreads) or 0
class TElasticQueue: public IThreadPool {
-public:
- explicit TElasticQueue(THolder<IThreadPool> slaveQueue);
-
- bool Add(IObjectInQueue* obj) override;
- size_t Size() const noexcept override;
-
- void Start(size_t threadCount, size_t maxQueueSize) override;
- void Stop() noexcept override;
-
- size_t ObjectCount() const;
-private:
- class TDecrementingWrapper;
-
- bool TryIncCounter();
-private:
+public:
+ explicit TElasticQueue(THolder<IThreadPool> slaveQueue);
+
+ bool Add(IObjectInQueue* obj) override;
+ size_t Size() const noexcept override;
+
+ void Start(size_t threadCount, size_t maxQueueSize) override;
+ void Stop() noexcept override;
+
+ size_t ObjectCount() const;
+private:
+ class TDecrementingWrapper;
+
+ bool TryIncCounter();
+private:
THolder<IThreadPool> SlaveQueue_;
- size_t MaxQueueSize_ = 0;
- TAtomic ObjectCount_ = 0;
- TAtomic GuardCount_ = 0;
-};
+ size_t MaxQueueSize_ = 0;
+ TAtomic ObjectCount_ = 0;
+ TAtomic GuardCount_ = 0;
+};