summaryrefslogtreecommitdiffstats
path: root/src/mixxxapplication.cpp
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2019-08-05 11:32:39 +0200
committerUwe Klotz <uklotz@mixxx.org>2019-08-06 08:09:59 +0200
commit6d9ec4ecd5e0e501c88b098053b533e638e80f2f (patch)
treedb6447b3ef51f281130ceebdf1ce09e780416410 /src/mixxxapplication.cpp
parent0758f7eb2a9574623beee1fb564d49989f670e44 (diff)
Initialize the global thread pool only once on application startup
Diffstat (limited to 'src/mixxxapplication.cpp')
-rw-r--r--src/mixxxapplication.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mixxxapplication.cpp b/src/mixxxapplication.cpp
index 6508223522..247edfbff8 100644
--- a/src/mixxxapplication.cpp
+++ b/src/mixxxapplication.cpp
@@ -1,10 +1,12 @@
#include <QtDebug>
#include <QTouchEvent>
+#include <QThreadPool>
+
#include "mixxxapplication.h"
-#include "library/crate/crateid.h"
#include "control/controlproxy.h"
-#include "mixxx.h"
+#include "library/crate/crateid.h"
+#include "track/track.h"
// When linking Qt statically on Windows we have to Q_IMPORT_PLUGIN all the
// plugins we link in build/depends.py.
@@ -36,6 +38,11 @@ MixxxApplication::MixxxApplication(int& argc, char** argv)
m_activeTouchButton(Qt::NoButton),
m_pTouchShift(NULL) {
registerMetaTypes();
+
+ // The global thread pool is initialized with the default
+ // number of treads. If a custom configuration is desired
+ // it should be done here before scheduling any tasks!
+ DEBUG_ASSERT(QThreadPool::globalInstance()->maxThreadCount() == QThread::idealThreadCount());
}
MixxxApplication::~MixxxApplication() {