Merge pull request #1694 from Trial97/concurrent

This commit is contained in:
Sefa Eyeoglu
2023-12-11 11:07:03 +01:00
parent 52ccf3d93b
commit 426deb4454
29 changed files with 169 additions and 111 deletions

View File

@ -37,13 +37,13 @@ class BasicTask_MultiStep : public Task {
class BigConcurrentTask : public ConcurrentTask {
Q_OBJECT
void startNext() override
void executeNextSubTask() override
{
// This is here only to help fill the stack a bit more quickly (if there's an issue, of course :^))
// Each tasks thus adds 1024 * 4 bytes to the stack, at the very least.
[[maybe_unused]] volatile std::array<uint32_t, 1024> some_data_on_the_stack{};
ConcurrentTask::startNext();
ConcurrentTask::executeNextSubTask();
}
};
@ -71,11 +71,14 @@ class BigConcurrentTaskThread : public QThread {
quit();
});
m_deadline.start();
if (thread() != QThread::currentThread()) {
QMetaObject::invokeMethod(this, &BigConcurrentTaskThread::start_timer, Qt::QueuedConnection);
}
big_task.run();
exec();
}
void start_timer() { m_deadline.start(); }
public:
bool passed_the_deadline = false;