| 6865 | } |
| 6866 | |
| 6867 | bool 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 | |
| 6903 | void ScriptingObjects::ScriptBackgroundTask::setProperty(String id, var value) |
| 6904 | { |
no test coverage detected