Add ThreadPool::getThreadCount()

Without the previously removed THREADCOUNT constant, there was no way to
query the ThreadCount from outside the class. This function provides
this.
This commit is contained in:
Stephen Seo 2021-09-07 20:18:41 +09:00
parent beb3eae6e2
commit 5c72ecb74b

View file

@ -172,6 +172,13 @@ public:
return fnQueue.empty(); return fnQueue.empty();
} }
/*!
\brief Returns the ThreadCount that this class was created with.
*/
unsigned int getThreadCount() {
return SIZE;
}
private: private:
std::vector<std::thread> threads; std::vector<std::thread> threads;
std::atomic_bool isAlive; std::atomic_bool isAlive;