mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-09 19:32:03 +02:00
QThreadPool: adjust max threads count (4)
This commit is contained in:
parent
cb1f3ad0ce
commit
a817bfba05
@ -1,8 +1,16 @@
|
|||||||
#include "FutureScheduler.h"
|
#include "FutureScheduler.h"
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
|
#include <QThreadPool>
|
||||||
|
|
||||||
FutureScheduler::FutureScheduler(QObject *parent)
|
FutureScheduler::FutureScheduler(QObject *parent)
|
||||||
: QObject(parent), Alive(0), Stopping(false)
|
: QObject(parent), Alive(0), Stopping(false)
|
||||||
{
|
{
|
||||||
|
static std::once_flag once;
|
||||||
|
std::call_once(once, []() {
|
||||||
|
QThreadPool::globalInstance()->setMaxThreadCount(4);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
FutureScheduler::~FutureScheduler()
|
FutureScheduler::~FutureScheduler()
|
||||||
|
Loading…
Reference in New Issue
Block a user