scheduler: don't hardcode maxThreadCount, set minimum to 8

This commit is contained in:
tobtoht 2023-03-01 21:21:48 +01:00
parent aa78e57148
commit 1dc8705c65
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
2 changed files with 5 additions and 4 deletions

View file

@ -232,6 +232,11 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
EventFilter filter;
app.installEventFilter(&filter);
auto *pool = QThreadPool::globalInstance();
if (pool->maxThreadCount() < 8) {
pool->setMaxThreadCount(8);
}
WindowManager windowManager(QCoreApplication::instance(), &filter);
QObject::connect(&app, &SingleApplication::instanceStarted, [&windowManager]() {

View file

@ -6,10 +6,6 @@
FutureScheduler::FutureScheduler(QObject *parent)
: QObject(parent), Alive(0), Stopping(false)
{
static std::once_flag once;
std::call_once(once, []() {
QThreadPool::globalInstance()->setMaxThreadCount(4);
});
}
FutureScheduler::~FutureScheduler()