Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 4 files). Show all
Unified · Split
| @@ -284,7 +284,7 @@ void ScriptEngine::runInThread() { · 283 unmodified lines | ||
| 284 | 284 | workerThread->start(); |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | −void ScriptEngine::wait() { | |
| 287 | +void ScriptEngine::waitTillDoneRunning() { | |
| 288 | 288 | auto workerThread = thread(); |
| 289 | 289 | |
| 290 | 290 | if (_isThreaded && workerThread) { |
| @@ -303,8 +303,9 @@ void ScriptEngine::wait() { · 12 unmodified lines | ||
| 303 | 303 | // Process events for the main application thread, allowing invokeMethod calls to pass between threads. |
| 304 | 304 | QCoreApplication::processEvents(); |
| 305 | 305 | |
| 306 | − // If the final evaluation takes too long, then tell the script engine to stop evaluating | |
| 306 | + // If the final evaluation takes too long, then tell the script engine to stop running | |
| 307 | 307 | auto elapsedUsecs = usecTimestampNow() - startedWaiting; |
| 308 | + static const auto MAX_SCRIPT_EVALUATION_TIME = USECS_PER_SECOND; | |
| 308 | 309 | if (elapsedUsecs > MAX_SCRIPT_EVALUATION_TIME) { |
| 309 | 310 | workerThread->quit(); |
| 310 | 311 | |