Browse Source

Fix regular build

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.5.0
falkTX 2 years ago
parent
commit
32196dd2fc
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 13 additions and 10 deletions
  1. +13
    -10
      source/utils/CarlaRunner.hpp

+ 13
- 10
source/utils/CarlaRunner.hpp View File

@@ -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;


Loading…
Cancel
Save