mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Merge b4f647fa36 into merged_master (Bitcoin PR bitcoin/bitcoin#23397)
This commit is contained in:
commit
fc6cc52f79
1 changed files with 13 additions and 5 deletions
|
|
@ -167,13 +167,21 @@ public:
|
|||
//! Add a batch of checks to the queue
|
||||
void Add(const std::vector<T*> vChecks)
|
||||
{
|
||||
LOCK(m_mutex);
|
||||
queue.insert(queue.end(), vChecks.begin(), vChecks.end());
|
||||
nTodo += vChecks.size();
|
||||
if (vChecks.size() == 1)
|
||||
if (vChecks.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
LOCK(m_mutex);
|
||||
queue.insert(queue.end(), vChecks.begin(), vChecks.end());
|
||||
nTodo += vChecks.size();
|
||||
}
|
||||
|
||||
if (vChecks.size() == 1) {
|
||||
m_worker_cv.notify_one();
|
||||
else if (vChecks.size() > 1)
|
||||
} else {
|
||||
m_worker_cv.notify_all();
|
||||
}
|
||||
}
|
||||
|
||||
//! Stop all of the worker threads.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue