Misc cleanup

This commit is contained in:
Antonio SJ Musumeci 2026-04-13 18:55:56 -05:00
parent ff48ff6047
commit fa06b4b8bd
74 changed files with 809 additions and 619 deletions

View file

@ -180,14 +180,21 @@ ThreadPool::ThreadPool(const unsigned thread_count_,
inline
ThreadPool::~ThreadPool()
{
std::vector<pthread_t> threads;
{
mutex_lockguard(_threads_mutex);
threads = _threads;
}
syslog(LOG_DEBUG,
"threadpool (%s): destroying %zu threads",
_name.c_str(),
_threads.size());
threads.size());
for(auto t : _threads)
for(auto t : threads)
pthread_cancel(t);
for(auto t : _threads)
for(auto t : threads)
pthread_join(t,NULL);
}