diff --git a/SpiralSound/ChannelHandler.C b/SpiralSound/ChannelHandler.C index c54e6c9..babd469 100644 --- a/SpiralSound/ChannelHandler.C +++ b/SpiralSound/ChannelHandler.C @@ -332,6 +332,20 @@ void ChannelHandler::Wait() bool last=m_UpdateIndicator; pthread_mutex_unlock(m_Mutex); + while (current==last) + { + usleep(10); + pthread_mutex_lock(m_Mutex); + current=m_UpdateIndicator; + pthread_mutex_unlock(m_Mutex); + } + + // do this twice (messages have to get there and back?) + pthread_mutex_lock(m_Mutex); + current=m_UpdateIndicator; + last=m_UpdateIndicator; + pthread_mutex_unlock(m_Mutex); + while (current==last) { usleep(10);