From 45a2f81eaa94a39ef619dfdb2aaaab46dba98d5c Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 13 Oct 2009 03:14:23 -0700 Subject: [PATCH] Rough fix for freeze-up bug Added startJobs() to the waitForJobs() loop, and don't give up in masterMix() until status of master channel is Done. --- include/mixer.h | 2 +- src/core/FxMixer.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/mixer.h b/include/mixer.h index d992920c6..d6db2cb12 100644 --- a/include/mixer.h +++ b/include/mixer.h @@ -620,7 +620,7 @@ public: m->m_workers[m->m_numWorkers]->processJobQueue(); while( s_jobQueue.itemsDone < s_jobQueue.queueSize ) { - SPINLOCK_PAUSE(); + startJobs(); } } diff --git a/src/core/FxMixer.cpp b/src/core/FxMixer.cpp index 4c3e17007..1e8a255e6 100644 --- a/src/core/FxMixer.cpp +++ b/src/core/FxMixer.cpp @@ -492,7 +492,10 @@ void FxMixer::masterMix( sampleFrame * _buf ) // to be processed. MixerWorkerThread::resetJobQueue(); addChannelLeaf( 0, _buf ); - MixerWorkerThread::startAndWaitForJobs(); + while( m_fxChannels[0]->m_state != ThreadableJob::Done ) + { + MixerWorkerThread::startAndWaitForJobs(); + } memcpy( _buf, m_fxChannels[0]->m_buffer, sizeof( sampleFrame ) * fpp );