aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_bitcoin.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2013-04-03 18:25:00 -0700
committerGavin Andresen <[email protected]>2013-04-03 18:25:00 -0700
commita0a437c86ae404152de883ac6a1463e6641eda1c (patch)
treee99240bd446613584b20c7b9762af5711bf3f7ff /src/test/test_bitcoin.cpp
parentMerge pull request #2453 from sipa/txstats (diff)
parentHave Qt poll for shutdown requested, the QT way. (diff)
downloaddiscoin-a0a437c86ae404152de883ac6a1463e6641eda1c.tar.xz
discoin-a0a437c86ae404152de883ac6a1463e6641eda1c.zip
Merge pull request #2357 from gavinandresen/shutdowncleanup
Thread / shutdown cleanup
Diffstat (limited to 'src/test/test_bitcoin.cpp')
-rw-r--r--src/test/test_bitcoin.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp
index 1116507a3..1bf9a28ac 100644
--- a/src/test/test_bitcoin.cpp
+++ b/src/test/test_bitcoin.cpp
@@ -17,6 +17,7 @@ extern void noui_connect();
struct TestingSetup {
CCoinsViewDB *pcoinsdbview;
boost::filesystem::path pathTemp;
+ boost::thread_group threadGroup;
TestingSetup() {
fPrintToDebugger = true; // don't want to write to debug.log file
@@ -35,11 +36,12 @@ struct TestingSetup {
RegisterWallet(pwalletMain);
nScriptCheckThreads = 3;
for (int i=0; i < nScriptCheckThreads-1; i++)
- NewThread(ThreadScriptCheck, NULL);
+ threadGroup.create_thread(&ThreadScriptCheck);
}
~TestingSetup()
{
- ThreadScriptCheckQuit();
+ threadGroup.interrupt_all();
+ threadGroup.join_all();
delete pwalletMain;
pwalletMain = NULL;
delete pcoinsTip;