1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-25 02:09:48 +01:00

* Temporarily work-around QSqliteDriver's race condition issues.

This commit is contained in:
Christian Muehlhaeuser 2012-06-01 06:47:02 +02:00
parent 4a47f6dd22
commit 4634f95b4c

View File

@ -26,7 +26,12 @@
#include "Source.h"
#define DEFAULT_WORKER_THREADS 4
#define MAX_WORKER_THREADS 16
#if ( QT_VERSION >= QT_VERSION_CHECK(4, 8, 2) )
#define MAX_WORKER_THREADS 1
#else
#define MAX_WORKER_THREADS 16
#endif
Database* Database::s_instance = 0;
@ -46,8 +51,12 @@ Database::Database( const QString& dbname, QObject* parent )
{
s_instance = this;
m_maxConcurrentThreads = qBound( DEFAULT_WORKER_THREADS, QThread::idealThreadCount(), MAX_WORKER_THREADS );
qDebug() << Q_FUNC_INFO << "Using" << m_maxConcurrentThreads << "threads";
if ( MAX_WORKER_THREADS < DEFAULT_WORKER_THREADS )
m_maxConcurrentThreads = MAX_WORKER_THREADS;
else
m_maxConcurrentThreads = qBound( DEFAULT_WORKER_THREADS, QThread::idealThreadCount(), MAX_WORKER_THREADS );
tDebug() << Q_FUNC_INFO << "Using" << m_maxConcurrentThreads << "database worker threads";
connect( m_impl, SIGNAL( indexReady() ), SIGNAL( indexReady() ) );
connect( m_impl, SIGNAL( indexReady() ), SIGNAL( ready() ) );