--- linuxsampler/trunk/src/engines/InstrumentManagerThread.cpp 2012/06/10 16:05:52 2348 +++ linuxsampler/trunk/src/engines/InstrumentManagerThread.cpp 2012/06/17 15:47:43 2349 @@ -23,6 +23,10 @@ #include "../common/global_private.h" #include "EngineChannelFactory.h" +#ifdef __APPLE__ +#include +#endif + namespace LinuxSampler { InstrumentManagerThread::InstrumentManagerThread() : Thread(true, false, 0, -4) { @@ -176,10 +180,16 @@ #ifdef __APPLE__ int InstrumentManagerThread::StopThread() { - // This is a fix for Mac OS X, where SignalStopThread doesn't - // wake up a thread waiting for a condition variable. - SignalStopThread(); // send stop signal, but don't wait - conditionJobsLeft.Set(true); // wake thread + utsname buf; + int osVersion = uname(&buf) ? 0 : atoi(buf.release); + + // This is a fix for Mac OS X 10.6 and earlier, where + // 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 + } return Thread::StopThread(); // then wait for it to cancel } #endif