cpp_project/vs-project/log_server/log_server/Sources/Utils/thread_pool.cpp
void
thread_pool::stop(void) {
	if (!is_running()) { return; }

	m_should_stop = true;
	m_tasks_condvar.notify_all();

	for (auto& worker : m_workers) { worker.join(); }

	m_workers.clear();

	__MC_LOG(debug, "thread_pool stopped");
}
//!
//! stop the thread pool and wait for workers completion
//!
stop the thread pool and wait for workers completion
stop the thread pool and wait for workers completion
void
thread_pool::stop(void) {
	if (!is_running()) { return; }
	m_should_stop = true;
	m_tasks_condvar.notify_all();
	for (auto& worker : m_workers) { worker.join(); }
	m_workers.clear();
	__MC_LOG(debug, "thread_pool stopped");
}
void thread_pool :: stop ( void ) { if ( ! is_running ( ) ) { return ; } m_should_stop = true ; m_tasks_condvar . notify_all ( ) ; for ( auto & worker : m_workers ) { worker . join ( ) ; } m_workers . clear ( ) ; __MC_LOG ( debug , " " ) ; }
stop the thread pool and wait for workers completion
stop the thread pool and wait for workers completion