Remove redundant ThreadPool#m_Threads

This commit is contained in:
Alexander A. Klimov 2023-01-27 16:34:11 +01:00
parent 288ad68649
commit c953ba1206
2 changed files with 2 additions and 4 deletions

View File

@ -5,8 +5,7 @@
using namespace icinga; using namespace icinga;
ThreadPool::ThreadPool() ThreadPool::ThreadPool() : m_Pending(0)
: m_Threads(Configuration::Concurrency * 2u), m_Pending(0)
{ {
Start(); Start();
} }
@ -21,7 +20,7 @@ void ThreadPool::Start()
boost::unique_lock<decltype(m_Mutex)> lock (m_Mutex); boost::unique_lock<decltype(m_Mutex)> lock (m_Mutex);
if (!m_Pool) { if (!m_Pool) {
m_Pool = decltype(m_Pool)(new boost::asio::thread_pool(m_Threads)); m_Pool = decltype(m_Pool)(new boost::asio::thread_pool(Configuration::Concurrency * 2u));
} }
} }

View File

@ -90,7 +90,6 @@ public:
private: private:
boost::shared_mutex m_Mutex; boost::shared_mutex m_Mutex;
std::unique_ptr<boost::asio::thread_pool> m_Pool; std::unique_ptr<boost::asio::thread_pool> m_Pool;
size_t m_Threads;
Atomic<uint_fast64_t> m_Pending; Atomic<uint_fast64_t> m_Pending;
}; };