From 32196dd2fc3a60912e807d324e95201e8c443b73 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 5 Jul 2022 09:44:46 +0100 Subject: [PATCH] Fix regular build Signed-off-by: falkTX --- source/utils/CarlaRunner.hpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/source/utils/CarlaRunner.hpp b/source/utils/CarlaRunner.hpp index 19a0aa611..8a99ab0d8 100644 --- a/source/utils/CarlaRunner.hpp +++ b/source/utils/CarlaRunner.hpp @@ -48,7 +48,7 @@ protected: */ CarlaRunner(const char* const runnerName = nullptr) noexcept #ifndef CARLA_OS_WASM - : fRunnerThread(runnerName), + : fRunnerThread(this, runnerName), #else : fRunnerName(runnerName), fShouldStop(false), @@ -122,7 +122,7 @@ public: bool stopRunner() noexcept { #ifndef CARLA_OS_WASM - return fRunnerThread.stopThread(); + return fRunnerThread.stopThread(-1); #else fShouldStop = true; return true; @@ -160,29 +160,32 @@ public: private: #ifndef CARLA_OS_WASM - class RunnerThread : private Thread + class RunnerThread : public CarlaThread { - Runner* const runner; + CarlaRunner* const runner; - RunnerThread(Runner* const r, const char* const tn, const uint t) - : Thread(rn), - runner(r), - timeInterval(t) {} + public: + RunnerThread(CarlaRunner* const r, const char* const rn) + : CarlaThread(rn), + runner(r) {} + protected: void run() override { + const uint timeInterval = runner->fTimeInterval; + while (!shouldThreadExit()) { bool stillRunning = false; try { - stillRunning = run(); + stillRunning = runner->run(); } catch(...) {} if (stillRunning && !shouldThreadExit()) { if (timeInterval != 0) - d_msleep(timeInterval) + carla_msleep(timeInterval); pthread_yield(); continue;