SpiecsEngine
 
Loading...
Searching...
No Matches

◆ ~ThreadPool_Basic()

template<typename ... Params>
Spices::ThreadPool_Basic< Params >::~ThreadPool_Basic ( )
inlinevirtual

Destructor Function.

Wait for all threads return.

Definition at line 476 of file ThreadPoolBasic.h.

477 {
479
480 m_IsPoolRunning = false;
481
485 std::unique_lock<std::mutex> lock(m_Mutex);
486 m_NotEmpty.notify_all();
487 m_ExitCond.wait(lock, [&]()->bool { return m_Threads.empty(); });
488 }
#define SPICES_PROFILE_ZONE
std::condition_variable m_ExitCond
Thread pool Exit Condition.
std::mutex m_Mutex
Mutex for thread safe.
std::unordered_map< uint32_t, std::unique_ptr< Thread< Params... > > > m_Threads
Threads Container.
std::condition_variable m_NotEmpty
Task Queue not empty.
std::atomic_bool m_IsPoolRunning
True if this thread pool is in use.

References Spices::ThreadPool_Basic< Params >::m_NotEmpty.