Skip to content

Commit

Permalink
Adjust thread priorities according to discussion in Bug #1270583.
Browse files Browse the repository at this point in the history
  • Loading branch information
rryan committed Mar 16, 2014
1 parent 31f60e4 commit 514cbad
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/analyserqueue.cpp
Expand Up @@ -421,7 +421,7 @@ AnalyserQueue* AnalyserQueue::createDefaultAnalyserQueue(
ret->addAnalyser(new AnalyserBeats(pConfig));
ret->addAnalyser(new AnalyserKey(pConfig));

ret->start(QThread::IdlePriority);
ret->start(QThread::LowPriority);
return ret;
}

Expand All @@ -436,6 +436,6 @@ AnalyserQueue* AnalyserQueue::createAnalysisFeatureAnalyserQueue(
ret->addAnalyser(new AnalyserBeats(pConfig));
ret->addAnalyser(new AnalyserKey(pConfig));

ret->start(QThread::IdlePriority);
ret->start(QThread::LowPriority);
return ret;
}
2 changes: 1 addition & 1 deletion src/cachingreader.cpp
Expand Up @@ -67,7 +67,7 @@ CachingReader::CachingReader(const char* group,
this, SIGNAL(trackLoadFailed(TrackPointer, QString)),
Qt::DirectConnection);

m_pWorker->start();
m_pWorker->start(QThread::HighPriority);
}


Expand Down
2 changes: 1 addition & 1 deletion src/engine/enginemaster.cpp
Expand Up @@ -53,7 +53,7 @@ EngineMaster::EngineMaster(ConfigObject<ConfigValue>* _config,
m_bBusOutputConnected[1] = false;
m_bBusOutputConnected[2] = false;
m_pWorkerScheduler = new EngineWorkerScheduler(this);
m_pWorkerScheduler->start();
m_pWorkerScheduler->start(QThread::HighPriority);

// Master sample rate
m_pMasterSampleRate = new ControlObject(ConfigKey(group, "samplerate"), true, true);
Expand Down
2 changes: 1 addition & 1 deletion src/library/browse/browsethread.cpp
Expand Up @@ -31,7 +31,7 @@ BrowseThread::BrowseThread(QObject *parent)
m_bStopThread = false;
m_model_observer = NULL;
//start Thread
start(QThread::LowestPriority);
start(QThread::LowPriority);

}

Expand Down
2 changes: 1 addition & 1 deletion src/library/itunes/itunesfeature.cpp
Expand Up @@ -323,7 +323,7 @@ void ITunesFeature::guessMusicLibraryMountpoint(QXmlStreamReader &xml) {
TreeItem* ITunesFeature::importLibrary() {
//Give thread a low priority
QThread* thisThread = QThread::currentThread();
thisThread->setPriority(QThread::LowestPriority);
thisThread->setPriority(QThread::LowPriority);

//Delete all table entries of iTunes feature
ScopedTransaction transaction(m_database);
Expand Down
5 changes: 1 addition & 4 deletions src/library/libraryscanner.cpp
Expand Up @@ -141,9 +141,6 @@ void LibraryScanner::run() {
QThread::currentThread()->setObjectName(QString("LibraryScanner %1").arg(++id));
//m_pProgress->slotStartTiming();

// Lower our priority to help not grind crappy computers.
setPriority(QThread::LowPriority);

qRegisterMetaType<QSet<int> >("QSet<int>");

if (!m_database.isValid()) {
Expand Down Expand Up @@ -326,7 +323,7 @@ void LibraryScanner::scan(QWidget* parent) {
this, SLOT(cancel()));
connect(&m_trackDao, SIGNAL(progressVerifyTracksOutside(QString)),
m_pProgress, SLOT(slotUpdate(QString)));
start();
start(QThread::LowPriority);
}

void LibraryScanner::cancel() {
Expand Down
2 changes: 1 addition & 1 deletion src/library/traktor/traktorfeature.cpp
Expand Up @@ -169,7 +169,7 @@ void TraktorFeature::activateChild(const QModelIndex& index) {
TreeItem* TraktorFeature::importLibrary(QString file) {
//Give thread a low priority
QThread* thisThread = QThread::currentThread();
thisThread->setPriority(QThread::LowestPriority);
thisThread->setPriority(QThread::LowPriority);
//Invisible root item of Traktor's child model
TreeItem* root = NULL;
//Delete all table entries of Traktor feature
Expand Down
2 changes: 1 addition & 1 deletion src/waveform/waveformwidgetfactory.cpp
Expand Up @@ -659,7 +659,7 @@ int WaveformWidgetFactory::findIndexOf(WWaveformViewer* viewer) const {

void WaveformWidgetFactory::startVSync(MixxxMainWindow* mixxxMainWindow) {
m_vsyncThread = new VSyncThread(mixxxMainWindow);
m_vsyncThread->start();
m_vsyncThread->start(QThread::NormalPriority);

connect(m_vsyncThread, SIGNAL(vsyncRender()),
this, SLOT(render()));
Expand Down

0 comments on commit 514cbad

Please sign in to comment.