220 |
} |
} |
221 |
} |
} |
222 |
|
|
223 |
|
//TODO: (hopefully) just a temporary nasty hack for launching gigedit on the main thread on Mac (see comments in gigedit.cpp for details) |
224 |
|
#if defined(__APPLE__) |
225 |
|
g_mainThreadCallbackSupported = true; |
226 |
|
#endif |
227 |
|
|
228 |
while (atomic_read(&running)) { |
while (atomic_read(&running)) { |
229 |
if (bPrintStatistics) { |
if (bPrintStatistics) { |
230 |
const std::set<Engine*>& engines = EngineFactory::EngineInstances(); |
const std::set<Engine*>& engines = EngineFactory::EngineInstances(); |
252 |
} |
} |
253 |
|
|
254 |
pSampler->fireStatistics(); |
pSampler->fireStatistics(); |
255 |
|
|
256 |
|
//TODO: (hopefully) just a temporary nasty hack for launching gigedit on the main thread on Mac (see comments in gigedit.cpp for details) |
257 |
|
#if defined(__APPLE__) |
258 |
|
if (g_fireMainThreadCallback && g_mainThreadCallback) { |
259 |
|
void (*fn)(void* info) = g_mainThreadCallback; |
260 |
|
void* info = g_mainThreadCallbackInfo; |
261 |
|
g_mainThreadCallbackInfo = NULL; |
262 |
|
g_mainThreadCallback = NULL; |
263 |
|
g_fireMainThreadCallback = false; |
264 |
|
printf("Received main thread callback, calling now ...\n"); fflush(stdout); |
265 |
|
(*fn)(info); |
266 |
|
printf("Main thread callback executed.\n"); fflush(stdout); |
267 |
|
} |
268 |
|
#endif |
269 |
} |
} |
270 |
|
//#endif |
271 |
if (pLSCPServer) pLSCPServer->StopThread(); |
if (pLSCPServer) pLSCPServer->StopThread(); |
272 |
// the delete order here is important: the Sampler |
// the delete order here is important: the Sampler |
273 |
// destructor sends notifications to the lscpserver |
// destructor sends notifications to the lscpserver |