* Named conditions; one data condition per channel

This commit is contained in:
Chris Cannam
2007-11-26 21:51:05 +00:00
parent d58531e2ca
commit ceec06a697
5 changed files with 45 additions and 24 deletions

View File

@@ -30,6 +30,12 @@ using std::endl;
namespace RubberBand {
RubberBandStretcher::Impl::ProcessThread::ProcessThread(Impl *s, size_t c) :
m_s(s),
m_channel(c),
m_dataAvailable(std::string("data ") + char('A' + c))
{ }
void
RubberBandStretcher::Impl::ProcessThread::run()
{
@@ -54,11 +60,11 @@ RubberBandStretcher::Impl::ProcessThread::run()
if (any) m_s->m_spaceAvailable.signal();
m_s->m_dataAvailable.lock();
m_dataAvailable.lock();
if (!m_s->testInbufReadSpace(m_channel)) {
m_s->m_dataAvailable.wait(500);
m_dataAvailable.wait();
} else {
m_s->m_dataAvailable.unlock();
m_dataAvailable.unlock();
}
}
@@ -71,6 +77,12 @@ RubberBandStretcher::Impl::ProcessThread::run()
}
}
void
RubberBandStretcher::Impl::ProcessThread::signalDataAvailable()
{
m_dataAvailable.signal();
}
void
RubberBandStretcher::Impl::processChunks(size_t c, bool &any, bool &last)
{