SpiecsEngine
 
Loading...
Searching...
No Matches

◆ Suspend()

template<typename ... Params>
void Spices::ThreadPool_Basic< Params >::Suspend ( )
inlineinherited

Suspend ThreadPool.

Definition at line 534 of file ThreadPoolBasic.h.

535 {
537
538 m_IsSuspend = true;
539
540 std::unique_lock<std::mutex> lock(m_Mutex);
541
542 m_IdleCond.wait(lock, [&]() { return m_IdleThreadSize.load() == m_NThreads.load(); });
543 }
#define SPICES_PROFILE_ZONE
bool m_IsSuspend
True if needs suspend on executing the task.
std::atomic_int m_IdleThreadSize
Idled thread size.
std::mutex m_Mutex
Mutex for thread safe.
std::atomic_int m_NThreads
Threads Count.
std::condition_variable m_IdleCond
Thread pool thread idle Condition.

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