mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Add local thread pool to CCheckQueue
This commit is contained in:
@@ -224,6 +224,7 @@ void Shutdown(NodeContext& node)
|
||||
if (g_load_block.joinable()) g_load_block.join();
|
||||
threadGroup.interrupt_all();
|
||||
threadGroup.join_all();
|
||||
StopScriptCheckWorkerThreads();
|
||||
|
||||
// After the threads that potentially access these pointers have been stopped,
|
||||
// destruct and reset all to nullptr.
|
||||
@@ -1307,9 +1308,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
|
||||
LogPrintf("Script verification uses %d additional threads\n", script_threads);
|
||||
if (script_threads >= 1) {
|
||||
g_parallel_script_checks = true;
|
||||
for (int i = 0; i < script_threads; ++i) {
|
||||
threadGroup.create_thread([i]() { return ThreadScriptCheck(i); });
|
||||
}
|
||||
StartScriptCheckWorkerThreads(script_threads);
|
||||
}
|
||||
|
||||
assert(!node.scheduler);
|
||||
|
||||
Reference in New Issue
Block a user