Merge branch 'master' into cxx17
This commit is contained in:
commit
5baa4e92b7
2 changed files with 18 additions and 0 deletions
|
@ -172,6 +172,13 @@ public:
|
|||
return fnQueue.empty();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Returns the ThreadCount that this class was created with.
|
||||
*/
|
||||
constexpr unsigned int getThreadCount() {
|
||||
return SIZE;
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<std::thread> threads;
|
||||
std::atomic_bool isAlive;
|
||||
|
|
|
@ -66,3 +66,14 @@ TEST(ECThreadPool, Simple) {
|
|||
|
||||
ASSERT_EQ(data.load(), 11);
|
||||
}
|
||||
|
||||
TEST(ECThreadPool, QueryCount) {
|
||||
{
|
||||
OneThreadPool oneP;
|
||||
ASSERT_EQ(1, oneP.getThreadCount());
|
||||
}
|
||||
{
|
||||
ThreeThreadPool threeP;
|
||||
ASSERT_EQ(3, threeP.getThreadCount());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue