diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-08-21 09:24:05 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-09-24 06:55:33 +0300 |
commit | 01511776acb0c7ec216dc9c8112531067763f1cb (patch) | |
tree | 4affd73ec2317bc425f8731600b98bb57dd232e8 /src/test/util/setup_common.cpp | |
parent | 0ef938685b5c079a6f5a98daf0e3865d718d817b (diff) | |
download | bitcoin-01511776acb0c7ec216dc9c8112531067763f1cb.tar.xz |
Add local thread pool to CCheckQueue
Diffstat (limited to 'src/test/util/setup_common.cpp')
-rw-r--r-- | src/test/util/setup_common.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index 2d3137e1e2..74498c6c79 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -162,9 +162,7 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const // Start script-checking threads. Set g_parallel_script_checks to true so they are used. constexpr int script_check_threads = 2; - for (int i = 0; i < script_check_threads; ++i) { - threadGroup.create_thread([i]() { return ThreadScriptCheck(i); }); - } + StartScriptCheckWorkerThreads(script_check_threads); g_parallel_script_checks = true; m_node.banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr, DEFAULT_MISBEHAVING_BANTIME); @@ -182,6 +180,7 @@ TestingSetup::~TestingSetup() if (m_node.scheduler) m_node.scheduler->stop(); threadGroup.interrupt_all(); threadGroup.join_all(); + StopScriptCheckWorkerThreads(); GetMainSignals().FlushBackgroundCallbacks(); GetMainSignals().UnregisterBackgroundSignalScheduler(); m_node.connman.reset(); |