diff options
| author | Gavin Andresen <[email protected]> | 2013-03-06 22:16:05 -0500 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2013-04-03 14:04:21 -0400 |
| commit | c8c2fbe07f1a5475aea3a2680af9130558c7e5c8 (patch) | |
| tree | 78e8007fa6898d8f7f6826ab59c0bab8a4aae417 /src/qt/bitcoin.cpp | |
| parent | Fix signed/unsigned comparison warnings (diff) | |
| download | discoin-c8c2fbe07f1a5475aea3a2680af9130558c7e5c8.tar.xz discoin-c8c2fbe07f1a5475aea3a2680af9130558c7e5c8.zip | |
Shutdown cleanup prep-work
Create a boost::thread_group object at the qt/bitcoind main-loop level
that will hold pointers to all the main-loop threads.
This will replace the vnThreadsRunning[] array.
For testing, ported the BitcoinMiner threads to use its
own boost::thread_group.
Diffstat (limited to 'src/qt/bitcoin.cpp')
| -rw-r--r-- | src/qt/bitcoin.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 2c47f30e9..a805e350e 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -11,6 +11,7 @@ #include "guiutil.h" #include "guiconstants.h" #include "init.h" +#include "util.h" #include "ui_interface.h" #include "paymentserver.h" @@ -215,9 +216,10 @@ int main(int argc, char *argv[]) if (GUIUtil::GetStartOnSystemStartup()) GUIUtil::SetStartOnSystemStartup(true); + boost::thread_group threadGroup; BitcoinGUI window; guiref = &window; - if(AppInit2()) + if(AppInit2(threadGroup)) { { // Put this in a block, so that the Model objects are cleaned up before @@ -259,6 +261,8 @@ int main(int argc, char *argv[]) } // Shutdown the core and its threads, but don't exit Bitcoin-Qt here Shutdown(NULL); + threadGroup.interrupt_all(); + threadGroup.join_all(); } else { |