From 082a61c69d7a539b5a48c4376a657f1c5aa92d81 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 24 Jan 2018 21:15:56 -0500 Subject: Move scheduler/threadGroup into common-init instead of per-app This resolves #12229 which pointed out a shutdown deadlock due to scheduler/checkqueue having been shut down while network message processing is still running. --- src/qt/bitcoin.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/qt') diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 0666dcb9a3..b26d99a20a 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -193,8 +192,6 @@ Q_SIGNALS: void runawayException(const QString &message); private: - boost::thread_group threadGroup; - CScheduler scheduler; /// Pass fatal exception message to UI thread void handleRunawayException(const std::exception *e); @@ -300,7 +297,7 @@ void BitcoinCore::initialize() try { qDebug() << __func__ << ": Running initialization in thread"; - bool rv = AppInitMain(threadGroup, scheduler); + bool rv = AppInitMain(); Q_EMIT initializeResult(rv); } catch (const std::exception& e) { handleRunawayException(&e); @@ -314,8 +311,7 @@ void BitcoinCore::shutdown() try { qDebug() << __func__ << ": Running Shutdown in thread"; - Interrupt(threadGroup); - threadGroup.join_all(); + Interrupt(); Shutdown(); qDebug() << __func__ << ": Shutdown finished"; Q_EMIT shutdownResult(); -- cgit v1.2.3