third_party/aten/contrib/data/threadpool/ThreadPool.cc
ThreadPool::~ThreadPool() {
   {
      std::unique_lock<std::mutex> lock(queue_mutex);
      stop = true;
   }
   condition.notify_all();
   for(std::thread &worker: workers)
      worker.join();
}
// the destructor joins all threads:
the destructor joins all threads.
the destructor joins all threads .
ThreadPool::~ThreadPool() {
   {
      std::unique_lock<std::mutex> lock(queue_mutex);
      stop = true;
   }
   condition.notify_all();
   for(std::thread &worker: workers)
      worker.join();
}
ThreadPool :: ~ ThreadPool ( ) { { std :: unique_lock < std :: mutex > lock ( queue_mutex ) ; stop = true ; } condition . notify_all ( ) ; for ( std :: thread & worker : workers ) worker . join ( ) ; }
the destructor joins all threads:
the destructor joins all threads :