From 50ac8e88c31a0dc59d3adae73e41631e887618bf Mon Sep 17 00:00:00 2001 From: nebogeo Date: Tue, 15 Oct 2002 22:59:17 +0000 Subject: [PATCH] Fixed the wait problem --- SpiralSound/ChannelHandler.C | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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);