History

Rename wait and unload in best thread

Zach Pomerantz committed 10 years ago

Commit 2140dc71 parent 806d06b4 files · +13 −15Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 4 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+3−2
@@ -284,7 +284,7 @@ void ScriptEngine::runInThread() { · 283 unmodified lines
284284 workerThread->start();
285285 }
286286
287−void ScriptEngine::wait() {
287+void ScriptEngine::waitTillDoneRunning() {
288288 auto workerThread = thread();
289289
290290 if (_isThreaded && workerThread) {
@@ -303,8 +303,9 @@ void ScriptEngine::wait() { · 12 unmodified lines
303303 // Process events for the main application thread, allowing invokeMethod calls to pass between threads.
304304 QCoreApplication::processEvents();
305305
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
307307 auto elapsedUsecs = usecTimestampNow() - startedWaiting;
308+ static const auto MAX_SCRIPT_EVALUATION_TIME = USECS_PER_SECOND;
308309 if (elapsedUsecs > MAX_SCRIPT_EVALUATION_TIME) {
309310 workerThread->quit();
310311