diff options
author | sievlev <sievlev@yandex-team.ru> | 2022-02-10 16:51:45 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:51:45 +0300 |
commit | c38d513b2c4ace7c22019ef4cc24003204b77391 (patch) | |
tree | 2d6749d50b5f7a18a7f6d8fba895a4fb633d60a5 /util/thread/pool.cpp | |
parent | 2441b91fbbba534805430952c0770c88c3df8236 (diff) | |
download | ydb-c38d513b2c4ace7c22019ef4cc24003204b77391.tar.gz |
Restoring authorship annotation for <sievlev@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/thread/pool.cpp')
-rw-r--r-- | util/thread/pool.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/util/thread/pool.cpp b/util/thread/pool.cpp index 05fad02e9b..cfe20d4929 100644 --- a/util/thread/pool.cpp +++ b/util/thread/pool.cpp @@ -76,7 +76,7 @@ public: , Blocking(params.Blocking_) , Catching(params.Catching_) , Namer(params) - , ShouldTerminate(1) + , ShouldTerminate(1) , MaxQueueSize(0) , ThreadCountExpected(0) , ThreadCountReal(0) @@ -98,7 +98,7 @@ public: } inline bool Add(IObjectInQueue* obj) { - if (AtomicGet(ShouldTerminate)) { + if (AtomicGet(ShouldTerminate)) { return false; } @@ -110,14 +110,14 @@ public: } with_lock (QueueMutex) { - while (MaxQueueSize > 0 && Queue.Size() >= MaxQueueSize && !AtomicGet(ShouldTerminate)) { + while (MaxQueueSize > 0 && Queue.Size() >= MaxQueueSize && !AtomicGet(ShouldTerminate)) { if (!Blocking) { return false; } QueuePopCond.Wait(QueueMutex); } - if (AtomicGet(ShouldTerminate)) { + if (AtomicGet(ShouldTerminate)) { return false; } @@ -157,7 +157,7 @@ public: private: inline void Start(size_t num, size_t maxque) { - AtomicSet(ShouldTerminate, 0); + AtomicSet(ShouldTerminate, 0); MaxQueueSize = maxque; ThreadCountExpected = num; @@ -174,7 +174,7 @@ private: } inline void Stop() { - AtomicSet(ShouldTerminate, 1); + AtomicSet(ShouldTerminate, 1); with_lock (QueueMutex) { QueuePopCond.BroadCast(); @@ -212,11 +212,11 @@ private: IObjectInQueue* job = nullptr; with_lock (QueueMutex) { - while (Queue.Empty() && !AtomicGet(ShouldTerminate)) { + while (Queue.Empty() && !AtomicGet(ShouldTerminate)) { QueuePushCond.Wait(QueueMutex); } - if (AtomicGet(ShouldTerminate) && Queue.Empty()) { + if (AtomicGet(ShouldTerminate) && Queue.Empty()) { tsr.Destroy(); break; @@ -264,7 +264,7 @@ private: TCondVar StopCond; TJobQueue Queue; TVector<TThreadRef> Tharr; - TAtomic ShouldTerminate; + TAtomic ShouldTerminate; size_t MaxQueueSize; size_t ThreadCountExpected; size_t ThreadCountReal; |