diff --git a/src/lib/thread/thread_pool.cpp b/src/lib/thread/thread_pool.cpp index 702f0c05504..b2f51ef8f9d 100644 --- a/src/lib/thread/thread_pool.cpp +++ b/src/lib/thread/thread_pool.cpp @@ -26,7 +26,7 @@ #endif ThreadPool::ThreadPool(Logger &logger) : - logger(logger), BS::thread_pool(std::max(getNumberOfCores(), DEFAULT_NUMBER_OF_THREADS)) { + BS::thread_pool(std::max(getNumberOfCores(), DEFAULT_NUMBER_OF_THREADS)), logger(logger) { start(); } @@ -35,6 +35,7 @@ void ThreadPool::start() { } void ThreadPool::shutdown() { - stopped = true; logger.info("Shutting down thread pool..."); + stopped = true; + wait(); }