Improvements to concurrent task
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
a7bdfb5f6b
commit
47dbb09115
@ -152,8 +152,12 @@ void ConcurrentTask::startNext()
|
|||||||
QMetaObject::invokeMethod(next.get(), &Task::start, Qt::QueuedConnection);
|
QMetaObject::invokeMethod(next.get(), &Task::start, Qt::QueuedConnection);
|
||||||
|
|
||||||
// Allow going up the number of concurrent tasks in case of tasks being added in the middle of a running task.
|
// Allow going up the number of concurrent tasks in case of tasks being added in the middle of a running task.
|
||||||
for (int i = 0; i < num_starts; i++)
|
for (int i = 0; i < num_starts; i++) {
|
||||||
|
QCoreApplication::processEvents();
|
||||||
|
if (m_aborted || m_doing.count() > m_total_max_size)
|
||||||
|
return;
|
||||||
QMetaObject::invokeMethod(this, &ConcurrentTask::startNext, Qt::QueuedConnection);
|
QMetaObject::invokeMethod(this, &ConcurrentTask::startNext, Qt::QueuedConnection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConcurrentTask::subTaskSucceeded(Task::Ptr task)
|
void ConcurrentTask::subTaskSucceeded(Task::Ptr task)
|
||||||
|
Loading…
Reference in New Issue
Block a user