mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
test: Use CCheckQueue local thread pool
This commit is contained in:
@@ -427,12 +427,10 @@ BOOST_AUTO_TEST_CASE(test_big_witness_transaction)
|
||||
|
||||
// check all inputs concurrently, with the cache
|
||||
PrecomputedTransactionData txdata(tx);
|
||||
boost::thread_group threadGroup;
|
||||
CCheckQueue<CScriptCheck> scriptcheckqueue(128);
|
||||
CCheckQueueControl<CScriptCheck> control(&scriptcheckqueue);
|
||||
|
||||
for (int i=0; i<20; i++)
|
||||
threadGroup.create_thread(std::bind(&CCheckQueue<CScriptCheck>::Thread, std::ref(scriptcheckqueue)));
|
||||
scriptcheckqueue.StartWorkerThreads(20);
|
||||
|
||||
std::vector<Coin> coins;
|
||||
for(uint32_t i = 0; i < mtx.vin.size(); i++) {
|
||||
@@ -454,9 +452,7 @@ BOOST_AUTO_TEST_CASE(test_big_witness_transaction)
|
||||
|
||||
bool controlCheck = control.Wait();
|
||||
assert(controlCheck);
|
||||
|
||||
threadGroup.interrupt_all();
|
||||
threadGroup.join_all();
|
||||
scriptcheckqueue.StopWorkerThreads();
|
||||
}
|
||||
|
||||
SignatureData CombineSignatures(const CMutableTransaction& input1, const CMutableTransaction& input2, const CTransactionRef tx)
|
||||
|
||||
Reference in New Issue
Block a user