/[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 2349 by persson, Sun Jun 17 15:47:43 2012 UTC revision 2351 by persson, Sat Jun 23 11:02:48 2012 UTC
# Line 23  Line 23 
23  #include "../common/global_private.h"  #include "../common/global_private.h"
24  #include "EngineChannelFactory.h"  #include "EngineChannelFactory.h"
25    
 #ifdef __APPLE__  
 #include <sys/utsname.h>  
 #endif  
   
26  namespace LinuxSampler {  namespace LinuxSampler {
27    
28      InstrumentManagerThread::InstrumentManagerThread() : Thread(true, false, 0, -4) {      InstrumentManagerThread::InstrumentManagerThread() : Thread(true, false, 0, -4) {
# Line 178  namespace LinuxSampler { Line 174  namespace LinuxSampler {
174          pThread->mutex.Unlock();          pThread->mutex.Unlock();
175      }      }
176    
177  #ifdef __APPLE__  #if defined(__APPLE__) && !defined(__x86_64__)
178      int InstrumentManagerThread::StopThread() {      int InstrumentManagerThread::StopThread() {
179          utsname buf;          // This is a fix for Mac OS X 32 bit, where SignalStopThread
180          int osVersion = uname(&buf) ? 0 : atoi(buf.release);          // doesn't wake up a thread waiting for a condition variable.
181            SignalStopThread(); // send stop signal, but don't wait
182          // This is a fix for Mac OS X 10.6 and earlier, where          conditionJobsLeft.Set(true); // wake thread
         // SignalStopThread doesn't wake up a thread waiting for a  
         // condition variable.  
         if (osVersion < 11) { // darwin 11 = OS X 10.7  
             SignalStopThread(); // send stop signal, but don't wait  
             conditionJobsLeft.Set(true); // wake thread  
         }  
183          return Thread::StopThread(); // then wait for it to cancel          return Thread::StopThread(); // then wait for it to cancel
184      }      }
185  #endif  #endif

Legend:
Removed from v.2349  
changed lines
  Added in v.2351

  ViewVC Help
Powered by ViewVC