From 21eb5adadbe3110a8708f2570185566e1f137a49 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Wed, 6 Mar 2013 22:31:26 -0500 Subject: Port Thread* methods to boost::thread_group --- src/test/test_bitcoin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/test') diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 1116507a34..1bf9a28acc 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; -- cgit v1.2.3