mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Prevent long-running threads from deadlocking the program with only 1 CPU
* Fixes #10391
This commit is contained in:
parent
b3bec8b2b4
commit
6a9ed21079
@ -19,6 +19,7 @@
|
|||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QThreadPool>
|
||||||
#include <QWindow>
|
#include <QWindow>
|
||||||
|
|
||||||
#include "cli/Utils.h"
|
#include "cli/Utils.h"
|
||||||
@ -64,6 +65,12 @@ int main(int argc, char** argv)
|
|||||||
Application::setApplicationVersion(KEEPASSXC_VERSION);
|
Application::setApplicationVersion(KEEPASSXC_VERSION);
|
||||||
app.setProperty("KPXC_QUALIFIED_APPNAME", "org.keepassxc.KeePassXC");
|
app.setProperty("KPXC_QUALIFIED_APPNAME", "org.keepassxc.KeePassXC");
|
||||||
|
|
||||||
|
// HACK: Prevent long-running threads from deadlocking the program with only 1 CPU
|
||||||
|
// See https://github.com/keepassxreboot/keepassxc/issues/10391
|
||||||
|
if (QThreadPool::globalInstance()->maxThreadCount() < 2) {
|
||||||
|
QThreadPool::globalInstance()->setMaxThreadCount(2);
|
||||||
|
}
|
||||||
|
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
parser.setApplicationDescription(QObject::tr("KeePassXC - cross-platform password manager"));
|
parser.setApplicationDescription(QObject::tr("KeePassXC - cross-platform password manager"));
|
||||||
parser.addPositionalArgument(
|
parser.addPositionalArgument(
|
||||||
|
Loading…
Reference in New Issue
Block a user