fix: only try to start tasks that are really there
This fixes an annoying issue where concurrent tasks would try to start multiple tasks even when there was not that many tasks to run in the first place, causing some amount of log spam. Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
9171f471ab
commit
369a8cdc74
@ -37,7 +37,8 @@ void ConcurrentTask::executeTask()
|
|||||||
{
|
{
|
||||||
m_total_size = m_queue.size();
|
m_total_size = m_queue.size();
|
||||||
|
|
||||||
for (int i = 0; i < m_total_max_size; i++) {
|
int num_starts = std::min(m_total_max_size, m_total_size);
|
||||||
|
for (int i = 0; i < num_starts; i++) {
|
||||||
QMetaObject::invokeMethod(this, &ConcurrentTask::startNext, Qt::QueuedConnection);
|
QMetaObject::invokeMethod(this, &ConcurrentTask::startNext, Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user