/[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 2326 by persson, Thu Mar 8 19:40:14 2012 UTC revision 2349 by persson, Sun Jun 17 15:47:43 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    
26    #ifdef __APPLE__
27    #include <sys/utsname.h>
28    #endif
29    
30  namespace LinuxSampler {  namespace LinuxSampler {
31    
32      InstrumentManagerThread::InstrumentManagerThread() : Thread(true, false, 0, -4) {      InstrumentManagerThread::InstrumentManagerThread() : Thread(true, false, 0, -4) {
# Line 176  namespace LinuxSampler { Line 180  namespace LinuxSampler {
180    
181  #ifdef __APPLE__  #ifdef __APPLE__
182      int InstrumentManagerThread::StopThread() {      int InstrumentManagerThread::StopThread() {
183          // This is a fix for Mac OS X, where SignalStopThread doesn't          utsname buf;
184          // wake up a thread waiting for a condition variable.          int osVersion = uname(&buf) ? 0 : atoi(buf.release);
185          SignalStopThread(); // send stop signal, but don't wait  
186          conditionJobsLeft.Set(true); // wake thread          // This is a fix for Mac OS X 10.6 and earlier, where
187            // SignalStopThread doesn't wake up a thread waiting for a
188            // condition variable.
189            if (osVersion < 11) { // darwin 11 = OS X 10.7
190                SignalStopThread(); // send stop signal, but don't wait
191                conditionJobsLeft.Set(true); // wake thread
192            }
193          return Thread::StopThread(); // then wait for it to cancel          return Thread::StopThread(); // then wait for it to cancel
194      }      }
195  #endif  #endif

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

  ViewVC Help
Powered by ViewVC