/[svn]/linuxsampler/trunk/src/engines/InstrumentManagerThread.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/InstrumentManagerThread.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1826 by iliev, Sat Jan 24 14:32:35 2009 UTC revision 2185 by persson, Sun Jun 19 09:09:38 2011 UTC
# Line 99  namespace LinuxSampler { Line 99  namespace LinuxSampler {
99      int InstrumentManagerThread::Main() {      int InstrumentManagerThread::Main() {
100          while (true) {          while (true) {
101    
102                          #if CONFIG_PTHREAD_TESTCANCEL              #if CONFIG_PTHREAD_TESTCANCEL
103                          TestCancel();              TestCancel();
104                          #endif              #endif
105    
106              while (!queue.empty()) {              while (!queue.empty()) {
107                  command_t cmd;                  command_t cmd;
# Line 145  namespace LinuxSampler { Line 145  namespace LinuxSampler {
145              // unlock condition object so it can be turned again by other thread              // unlock condition object so it can be turned again by other thread
146              conditionJobsLeft.Unlock();              conditionJobsLeft.Unlock();
147          }          }
148            return 0;
149      }      }
150        
151      void InstrumentManagerThread::EventHandler::ChannelToBeRemoved(SamplerChannel* pChannel) {      void InstrumentManagerThread::EventHandler::ChannelToBeRemoved(SamplerChannel* pChannel) {
152          /*          /*
153             Removing from the queue an eventual scheduled loading of an instrument             Removing from the queue an eventual scheduled loading of an instrument
# Line 166  namespace LinuxSampler { Line 167  namespace LinuxSampler {
167          }          }
168          pThread->mutex.Unlock();          pThread->mutex.Unlock();
169      }      }
170    
171        int InstrumentManagerThread::StopThread() {
172            // This is a fix for Mac OS X, where SignalStopThread doesn't
173            // wake up a thread waiting for a condition variable.
174            SignalStopThread(); // send stop signal, but don't wait
175            conditionJobsLeft.Set(true); // wake thread
176            return Thread::StopThread(); // then wait for it to cancel
177        }
178    
179  } // namespace LinuxSampler  } // namespace LinuxSampler

Legend:
Removed from v.1826  
changed lines
  Added in v.2185

  ViewVC Help
Powered by ViewVC