Testing if submit thread task for each successfully.
385 {
386
388
389 auto func = []() -> void
390 {
391 std::this_thread::sleep_for(std::chrono::seconds(2));
392 };
393
394 m_ThreadPool.SubmitThreadTask_LightWeight_ForEach(func);
395
396
397 m_ThreadPool.Wait();
398
399 EXPECT_EQ(m_ThreadPool.GetInitThreadSize() ,nThreads );
400 EXPECT_EQ(m_ThreadPool.GetIdleThreadSize() ,nThreads );
402 EXPECT_EQ(m_ThreadPool.GetTasks() ,0 );
403 EXPECT_EQ(m_ThreadPool.GetThreadsCount() ,nThreads );
405 EXPECT_EQ(m_ThreadPool.IsPoolRunning() ,true );
406
407 for (auto& pair : m_ThreadPool.GetThreads())
408 {
409 EXPECT_EQ(pair.second->GetThreadTasksCount(),0);
410 }
411 }
#define SPICESTEST_PROFILE_FUNCTION()
constexpr uint32_t THREAD_MAX_IDLE_TIME