]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
scheduler: don't hardcode maxThreadCount, set minimum to 8
authortobtoht <tob@featherwallet.org>
Wed, 1 Mar 2023 20:21:48 +0000 (21:21 +0100)
committertobtoht <tob@featherwallet.org>
Wed, 1 Mar 2023 20:21:48 +0000 (21:21 +0100)
src/main.cpp
src/utils/scheduler.cpp

index 15894bef650141cbf31e07792aca96726d671ff9..cf78968ac9f58da8cca77e2e1e29f4d07e2f2ea9 100644 (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]() {
index 835c408b395a24e35f10ce1a464da942fc0db628..46101654e9e735f049eeeebed7a71a422a13e535 100644 (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()