UI: AppInfoWorker: Low priority thread

This commit is contained in:
Nodir Temirkhodjaev 2023-02-10 13:16:24 +03:00
parent 0c67cd0fbd
commit 5e86082230
3 changed files with 7 additions and 0 deletions

View File

@ -15,6 +15,8 @@ public:
AppInfoManager *manager() const;
QThread::Priority priority() const override { return QThread::LowPriority; }
void run() override;
protected:

View File

@ -7,6 +7,8 @@ WorkerObject::WorkerObject(WorkerManager *manager) : m_manager(manager) { }
void WorkerObject::run()
{
QThread::currentThread()->setPriority(priority());
for (;;) {
WorkerJob *job = manager()->dequeueJob();
if (!job)

View File

@ -3,6 +3,7 @@
#include <QObject>
#include <QRunnable>
#include <QThread>
class WorkerJob;
class WorkerManager;
@ -14,6 +15,8 @@ public:
WorkerManager *manager() const { return m_manager; }
virtual QThread::Priority priority() const { return QThread::NormalPriority; }
void run() override;
protected: