MCPcopy Create free account
hub / github.com/christophhart/HISE / shouldAbort

Method shouldAbort

hi_scripting/scripting/api/ScriptingApiObjects.cpp:6867–6901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6865}
6866
6867bool ScriptingObjects::ScriptBackgroundTask::shouldAbort()
6868{
6869#if PERFETTO
6870 perfetto::CounterTrack ct(abortId.getCharPointer().getAddress());
6871 TRACE_COUNTER("scripting", ct, ++numAbortChecks);
6872#endif
6873
6874#if USE_BACKEND
6875 auto now = Time::getCurrentTime();
6876 auto delta = now.getMilliseconds() - lastAbortCheck.getMilliseconds();
6877
6878 if(delta > timeOut)
6879 {
6880 String errorMessage;
6881 errorMessage << "WARNING: time between abort checks " << String(delta) << " ms) is above timeout (" << String(timeOut) << " ms).";
6882 errorMessage << "\ngoto ";
6883 auto loc = getCurrentLocationInFunctionCall();
6884 errorMessage << loc.fileName << "@" << loc.charNumber;
6885 debugToConsole(dynamic_cast<Processor*>(getScriptProcessor()), errorMessage);
6886 }
6887
6888 lastAbortCheck = now;
6889#endif
6890
6891 if (auto engine = dynamic_cast<JavascriptProcessor*>(getScriptProcessor())->getScriptEngine())
6892 {
6893 engine->extendTimeout(timeOut + 10);
6894 }
6895 else
6896 {
6897 signalThreadShouldExit();
6898 }
6899
6900 return threadShouldExit();
6901}
6902
6903void ScriptingObjects::ScriptBackgroundTask::setProperty(String id, var value)
6904{

Callers 1

runMethod · 0.45

Calls 5

getMillisecondsMethod · 0.80
getScriptEngineMethod · 0.80
StringClass · 0.50
getAddressMethod · 0.45
extendTimeoutMethod · 0.45

Tested by

no test coverage detected