Browse Source

Fixed the wait problem

master
nebogeo 22 years ago
parent
commit
50ac8e88c3
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      SpiralSound/ChannelHandler.C

+ 14
- 0
SpiralSound/ChannelHandler.C View File

@@ -332,6 +332,20 @@ void ChannelHandler::Wait()
bool last=m_UpdateIndicator; bool last=m_UpdateIndicator;
pthread_mutex_unlock(m_Mutex); 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) while (current==last)
{ {
usleep(10); usleep(10);


Loading…
Cancel
Save