mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-17 00:07:51 +00:00
Merge pull request #3198
a817bfba
QThreadPool: adjust max threads count (4) (xiphon)
This commit is contained in:
commit
0ae4677a25
1 changed files with 8 additions and 0 deletions
|
@ -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 a new issue