mirror of
https://github.com/tnodir/fort
synced 2024-11-15 05:36:09 +00:00
UI: AppInfoWorker: Low priority thread
This commit is contained in:
parent
0c67cd0fbd
commit
5e86082230
@ -15,6 +15,8 @@ public:
|
||||
|
||||
AppInfoManager *manager() const;
|
||||
|
||||
QThread::Priority priority() const override { return QThread::LowPriority; }
|
||||
|
||||
void run() override;
|
||||
|
||||
protected:
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user