diff options
author | agorodilov <agorodilov@yandex-team.ru> | 2022-02-10 16:47:09 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:09 +0300 |
commit | bd5ef432f5cfb1e18851381329d94665a4c22470 (patch) | |
tree | b83306b6e37edeea782e9eed673d89286c4fef35 /util/thread | |
parent | 7a4979e6211c3e78c7f9041d4a9e5d3405343c36 (diff) | |
download | ydb-bd5ef432f5cfb1e18851381329d94665a4c22470.tar.gz |
Restoring authorship annotation for <agorodilov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/thread')
-rw-r--r-- | util/thread/factory.cpp | 4 | ||||
-rw-r--r-- | util/thread/factory.h | 8 | ||||
-rw-r--r-- | util/thread/factory_ut.cpp | 4 | ||||
-rw-r--r-- | util/thread/lfstack.h | 2 | ||||
-rw-r--r-- | util/thread/pool.cpp | 10 | ||||
-rw-r--r-- | util/thread/pool.h | 22 | ||||
-rw-r--r-- | util/thread/pool_ut.cpp | 8 |
7 files changed, 29 insertions, 29 deletions
diff --git a/util/thread/factory.cpp b/util/thread/factory.cpp index 381c11e4f8..48e898f32d 100644 --- a/util/thread/factory.cpp +++ b/util/thread/factory.cpp @@ -16,7 +16,7 @@ namespace { } } - void DoRun(IThreadAble* func) override { + void DoRun(IThreadAble* func) override { Thr_.Reset(new TThread(ThreadProc, func)); Thr_->Start(); @@ -45,7 +45,7 @@ namespace { inline TSystemThreadFactory() noexcept { } - IThread* DoCreate() override { + IThread* DoCreate() override { return new TPoolThread; } }; diff --git a/util/thread/factory.h b/util/thread/factory.h index f56f624618..561fcbac88 100644 --- a/util/thread/factory.h +++ b/util/thread/factory.h @@ -7,9 +7,9 @@ class IThreadFactory { public: class IThreadAble { public: - inline IThreadAble() noexcept = default; + inline IThreadAble() noexcept = default; - virtual ~IThreadAble() = default; + virtual ~IThreadAble() = default; inline void Execute() { DoExecute(); @@ -23,9 +23,9 @@ public: friend class IThreadFactory; public: - inline IThread() noexcept = default; + inline IThread() noexcept = default; - virtual ~IThread() = default; + virtual ~IThread() = default; inline void Join() noexcept { DoJoin(); diff --git a/util/thread/factory_ut.cpp b/util/thread/factory_ut.cpp index 5e340fe4c8..647d96c901 100644 --- a/util/thread/factory_ut.cpp +++ b/util/thread/factory_ut.cpp @@ -15,9 +15,9 @@ class TThrPoolTest: public TTestBase { { } - ~TRunAble() override = default; + ~TRunAble() override = default; - void DoExecute() override { + void DoExecute() override { done = true; } diff --git a/util/thread/lfstack.h b/util/thread/lfstack.h index 8a3ea70638..ca3d95f3c3 100644 --- a/util/thread/lfstack.h +++ b/util/thread/lfstack.h @@ -11,7 +11,7 @@ class TLockFreeStack: TNonCopyable { T Value; TNode* Next; - TNode() = default; + TNode() = default; template <class U> explicit TNode(U&& val) diff --git a/util/thread/pool.cpp b/util/thread/pool.cpp index d2a921f199..05fad02e9b 100644 --- a/util/thread/pool.cpp +++ b/util/thread/pool.cpp @@ -201,7 +201,7 @@ private: } } - void DoExecute() override { + void DoExecute() override { THolder<TTsr> tsr(new TTsr(Parent_)); if (Namer) { @@ -652,7 +652,7 @@ namespace { { } - void Process(void* data) override { + void Process(void* data) override { THolder<TOwnedObjectInQueue> self(this); Owned->Process(data); } @@ -688,7 +688,7 @@ namespace { { } - ~TThreadImpl() override = default; + ~TThreadImpl() override = default; inline void WaitForStart() noexcept { StartEvent_.Wait(); @@ -699,7 +699,7 @@ namespace { } private: - void Process(void* /*tsr*/) override { + void Process(void* /*tsr*/) override { TThreadImplRef This(this); { @@ -736,7 +736,7 @@ namespace { } private: - void DoRun(IThreadAble* func) override { + void DoRun(IThreadAble* func) override { TThreadImplRef impl(new TThreadImpl(func)); Parent_->SafeAdd(impl.Get()); diff --git a/util/thread/pool.h b/util/thread/pool.h index de3fbd11ab..d1ea3a67cb 100644 --- a/util/thread/pool.h +++ b/util/thread/pool.h @@ -13,7 +13,7 @@ class TDuration; struct IObjectInQueue { - virtual ~IObjectInQueue() = default; + virtual ~IObjectInQueue() = default; /** * Supposed to be implemented by user, to define jobs processed @@ -227,7 +227,7 @@ public: } private: - IThread* DoCreate() override; + IThread* DoCreate() override; }; /** @@ -237,14 +237,14 @@ private: */ class TFakeThreadPool: public IThreadPool { public: - bool Add(IObjectInQueue* pObj) override Y_WARN_UNUSED_RESULT { + bool Add(IObjectInQueue* pObj) override Y_WARN_UNUSED_RESULT { TTsr tsr(this); pObj->Process(tsr); return true; } - void Start(size_t, size_t = 0) override { + void Start(size_t, size_t = 0) override { } void Stop() noexcept override { @@ -269,12 +269,12 @@ public: TThreadPool(const TParams& params = {}); ~TThreadPool() override; - bool Add(IObjectInQueue* obj) override Y_WARN_UNUSED_RESULT; + bool Add(IObjectInQueue* obj) override Y_WARN_UNUSED_RESULT; /** * @param queueSizeLimit means "unlimited" when = 0 * @param threadCount means "single thread" when = 0 */ - void Start(size_t threadCount, size_t queueSizeLimit = 0) override; + void Start(size_t threadCount, size_t queueSizeLimit = 0) override; void Stop() noexcept override; size_t Size() const noexcept override; size_t GetThreadCountExpected() const noexcept; @@ -302,7 +302,7 @@ public: */ void SetMaxIdleTime(TDuration interval); - bool Add(IObjectInQueue* obj) override Y_WARN_UNUSED_RESULT; + bool Add(IObjectInQueue* obj) override Y_WARN_UNUSED_RESULT; /** @param thrnum, @param maxque are ignored */ void Start(size_t thrnum = 0, size_t maxque = 0) override; void Stop() noexcept override; @@ -319,12 +319,12 @@ public: TSimpleThreadPool(const TParams& params = {}); ~TSimpleThreadPool() override; - bool Add(IObjectInQueue* obj) override Y_WARN_UNUSED_RESULT; + bool Add(IObjectInQueue* obj) override Y_WARN_UNUSED_RESULT; /** * @parameter thrnum. If thrnum is 0, use TAdaptiveThreadPool with small * SetMaxIdleTime interval parameter. if thrnum is not 0, use non-blocking TThreadPool */ - void Start(size_t thrnum, size_t maxque = 0) override; + void Start(size_t thrnum, size_t maxque = 0) override; void Stop() noexcept override; size_t Size() const noexcept override; @@ -365,11 +365,11 @@ public: } } - void* CreateThreadSpecificResource() override { + void* CreateThreadSpecificResource() override { return Slave_->CreateThreadSpecificResource(); } - void DestroyThreadSpecificResource(void* resource) override { + void DestroyThreadSpecificResource(void* resource) override { Slave_->DestroyThreadSpecificResource(resource); } diff --git a/util/thread/pool_ut.cpp b/util/thread/pool_ut.cpp index 2dc725da7c..893770d0c4 100644 --- a/util/thread/pool_ut.cpp +++ b/util/thread/pool_ut.cpp @@ -23,7 +23,7 @@ struct TThreadPoolTest { { } - void Process(void*) override { + void Process(void*) override { THolder<TTask> This(this); TGuard<TSpinLock> guard(Test->Lock); @@ -41,7 +41,7 @@ struct TThreadPoolTest { { } - ~TOwnedTask() override { + ~TOwnedTask() override { Destructed = true; } @@ -75,11 +75,11 @@ struct TThreadPoolTest { class TFailAddQueue: public IThreadPool { public: - bool Add(IObjectInQueue* /*obj*/) override Y_WARN_UNUSED_RESULT { + bool Add(IObjectInQueue* /*obj*/) override Y_WARN_UNUSED_RESULT { return false; } - void Start(size_t, size_t) override { + void Start(size_t, size_t) override { } void Stop() noexcept override { |