Skip to content

Commit

Permalink
fix: crash on shutdown (opentibiabr#2676)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehah authored Jun 12, 2024
1 parent e20e7eb commit 7c3393a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/thread/thread_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#endif

ThreadPool::ThreadPool(Logger &logger) :
logger(logger), BS::thread_pool(std::max<int>(getNumberOfCores(), DEFAULT_NUMBER_OF_THREADS)) {
BS::thread_pool(std::max<int>(getNumberOfCores(), DEFAULT_NUMBER_OF_THREADS)), logger(logger) {
start();
}

Expand All @@ -35,6 +35,7 @@ void ThreadPool::start() {
}

void ThreadPool::shutdown() {
stopped = true;
logger.info("Shutting down thread pool...");
stopped = true;
wait();
}

0 comments on commit 7c3393a

Please sign in to comment.