|
|
@@ -23,7 +23,7 @@ |
|
|
|
# include "CarlaThread.hpp" |
|
|
|
#else |
|
|
|
# include "CarlaString.hpp" |
|
|
|
# include <emscripten/emscripten.h> |
|
|
|
# include <emscripten/html5.h> |
|
|
|
#endif |
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -110,7 +110,7 @@ public: |
|
|
|
return fRunnerThread.startThread(); |
|
|
|
#else |
|
|
|
fShouldStop = false; |
|
|
|
emscripten_async_call(_entryPoint, this, timeIntervalMilliseconds); |
|
|
|
emscripten_set_timeout_loop(_entryPoint, timeIntervalMilliseconds, this); |
|
|
|
return true; |
|
|
|
#endif |
|
|
|
} |
|
|
@@ -200,10 +200,10 @@ private: |
|
|
|
const CarlaString fRunnerName; |
|
|
|
volatile bool fShouldStop; |
|
|
|
|
|
|
|
void _runEntryPoint() noexcept |
|
|
|
EM_BOOL _runEntryPoint() noexcept |
|
|
|
{ |
|
|
|
if (fShouldStop) |
|
|
|
return; |
|
|
|
return EM_FALSE; |
|
|
|
|
|
|
|
bool stillRunning = false; |
|
|
|
|
|
|
@@ -212,12 +212,14 @@ private: |
|
|
|
} catch(...) {} |
|
|
|
|
|
|
|
if (stillRunning && !fShouldStop) |
|
|
|
emscripten_async_call(_entryPoint, this, fTimeInterval); |
|
|
|
return EM_TRUE; |
|
|
|
|
|
|
|
return EM_FALSE; |
|
|
|
} |
|
|
|
|
|
|
|
static void _entryPoint(void* const userData) noexcept |
|
|
|
static EM_BOOL _entryPoint(double, void* const userData) noexcept |
|
|
|
{ |
|
|
|
static_cast<CarlaRunner*>(userData)->_runEntryPoint(); |
|
|
|
return static_cast<CarlaRunner*>(userData)->_runEntryPoint(); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|