Testing if submit very much pool task successfully.
323 {
324
326
327 auto func = [](int sec) -> bool
328 {
329 std::this_thread::sleep_for(std::chrono::microseconds(sec));
330 return true;
331 };
332
333 std::vector<std::future<bool>> futures(10000);
334 for (int i = 0; i < 10000; i++)
335 {
336 futures[i] = m_ThreadPool.SubmitPoolTask(std::bind(func, 1));
337 }
338
339
340 m_ThreadPool.Wait();
341
342 EXPECT_EQ(m_ThreadPool.GetInitThreadSize() ,nThreads );
343 EXPECT_EQ(m_ThreadPool.GetIdleThreadSize() ,nThreads );
345 EXPECT_EQ(m_ThreadPool.GetTasks() ,0 );
346 EXPECT_EQ(m_ThreadPool.GetThreadsCount() ,nThreads );
348 EXPECT_EQ(m_ThreadPool.IsPoolRunning() ,true );
349 }
#define SPICESTEST_PROFILE_FUNCTION()
constexpr uint32_t THREAD_MAX_IDLE_TIME