aboutsummaryrefslogtreecommitdiffstats
path: root/util/thread/pool.cpp
diff options
context:
space:
mode:
authorspacelord <spacelord@yandex-team.ru>2022-02-10 16:48:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:15 +0300
commita0c6d9ad0cf6b94c527a15da147eb24335281b6d (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /util/thread/pool.cpp
parent16747e4f77455cca4932df21eb76f12cb0a97a5c (diff)
downloadydb-a0c6d9ad0cf6b94c527a15da147eb24335281b6d.tar.gz
Restoring authorship annotation for <spacelord@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/thread/pool.cpp')
-rw-r--r--util/thread/pool.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/util/thread/pool.cpp b/util/thread/pool.cpp
index e8420eb3c8..05fad02e9b 100644
--- a/util/thread/pool.cpp
+++ b/util/thread/pool.cpp
@@ -67,7 +67,7 @@ TThreadFactoryHolder::TThreadFactoryHolder() noexcept
class TThreadPool::TImpl: public TIntrusiveListItem<TImpl>, public IThreadFactory::IThreadAble {
using TTsr = IThreadPool::TTsr;
- using TJobQueue = TFastQueue<IObjectInQueue*>;
+ using TJobQueue = TFastQueue<IObjectInQueue*>;
using TThreadRef = THolder<IThreadFactory::IThread>;
public:
@@ -643,20 +643,20 @@ size_t TSimpleThreadPool::Size() const noexcept {
namespace {
class TOwnedObjectInQueue: public IObjectInQueue {
- private:
- THolder<IObjectInQueue> Owned;
-
- public:
+ private:
+ THolder<IObjectInQueue> Owned;
+
+ public:
TOwnedObjectInQueue(THolder<IObjectInQueue> owned)
: Owned(std::move(owned))
- {
- }
-
+ {
+ }
+
void Process(void* data) override {
- THolder<TOwnedObjectInQueue> self(this);
- Owned->Process(data);
- }
- };
+ THolder<TOwnedObjectInQueue> self(this);
+ Owned->Process(data);
+ }
+ };
}
void IThreadPool::SafeAdd(IObjectInQueue* obj) {
@@ -665,17 +665,17 @@ void IThreadPool::SafeAdd(IObjectInQueue* obj) {
void IThreadPool::SafeAddAndOwn(THolder<IObjectInQueue> obj) {
Y_ENSURE_EX(AddAndOwn(std::move(obj)), TThreadPoolException() << TStringBuf("can not add to queue and own"));
-}
-
+}
+
bool IThreadPool::AddAndOwn(THolder<IObjectInQueue> obj) {
auto owner = MakeHolder<TOwnedObjectInQueue>(std::move(obj));
- bool added = Add(owner.Get());
- if (added) {
+ bool added = Add(owner.Get());
+ if (added) {
Y_UNUSED(owner.Release());
- }
- return added;
-}
-
+ }
+ return added;
+}
+
using IThread = IThreadFactory::IThread;
using IThreadAble = IThreadFactory::IThreadAble;
@@ -721,7 +721,7 @@ namespace {
TSystemEvent StartEvent_;
};
- using TThreadImplRef = TIntrusivePtr<TThreadImpl>;
+ using TThreadImplRef = TIntrusivePtr<TThreadImpl>;
public:
inline TPoolThread(IThreadPool* parent)