diff options
author | eeight <eeight@yandex-team.ru> | 2022-02-10 16:46:19 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:19 +0300 |
commit | bd085aee9b4f7a0bee302ce687964ffb7098f986 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/thread/factory.cpp | |
parent | 475c0a46f28166e83fd263badc7546377cddcabe (diff) | |
download | ydb-bd085aee9b4f7a0bee302ce687964ffb7098f986.tar.gz |
Restoring authorship annotation for <eeight@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/thread/factory.cpp')
-rw-r--r-- | util/thread/factory.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/util/thread/factory.cpp b/util/thread/factory.cpp index afe2d20760..48e898f32d 100644 --- a/util/thread/factory.cpp +++ b/util/thread/factory.cpp @@ -1,12 +1,12 @@ -#include "factory.h" +#include "factory.h" #include <util/system/thread.h> #include <util/generic/singleton.h> -using IThread = IThreadFactory::IThread; +using IThread = IThreadFactory::IThread; namespace { - class TSystemThreadFactory: public IThreadFactory { + class TSystemThreadFactory: public IThreadFactory { public: class TPoolThread: public IThread { public: @@ -42,7 +42,7 @@ namespace { THolder<TThread> Thr_; }; - inline TSystemThreadFactory() noexcept { + inline TSystemThreadFactory() noexcept { } IThread* DoCreate() override { @@ -50,14 +50,14 @@ namespace { } }; - class TThreadFactoryFuncObj: public IThreadFactory::IThreadAble { + class TThreadFactoryFuncObj: public IThreadFactory::IThreadAble { public: - TThreadFactoryFuncObj(const std::function<void()>& func) + TThreadFactoryFuncObj(const std::function<void()>& func) : Func(func) { } void DoExecute() override { - THolder<TThreadFactoryFuncObj> self(this); + THolder<TThreadFactoryFuncObj> self(this); Func(); } @@ -69,18 +69,18 @@ namespace { THolder<IThread> IThreadFactory::Run(std::function<void()> func) { THolder<IThread> ret(DoCreate()); - ret->Run(new ::TThreadFactoryFuncObj(func)); + ret->Run(new ::TThreadFactoryFuncObj(func)); return ret; } -static IThreadFactory* SystemThreadPoolImpl() { - return Singleton<TSystemThreadFactory>(); +static IThreadFactory* SystemThreadPoolImpl() { + return Singleton<TSystemThreadFactory>(); } -static IThreadFactory* systemPool = nullptr; +static IThreadFactory* systemPool = nullptr; -IThreadFactory* SystemThreadFactory() { +IThreadFactory* SystemThreadFactory() { if (systemPool) { return systemPool; } @@ -88,6 +88,6 @@ IThreadFactory* SystemThreadFactory() { return SystemThreadPoolImpl(); } -void SetSystemThreadFactory(IThreadFactory* pool) { +void SetSystemThreadFactory(IThreadFactory* pool) { systemPool = pool; } |