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
284 workerThread->start();284 workerThread->start();
285}285}
286 286
287void ScriptEngine::wait() {287void ScriptEngine::waitTillDoneRunning() {
288 auto workerThread = thread();288 auto workerThread = thread();
289 289
290 if (_isThreaded && workerThread) {290 if (_isThreaded && workerThread) {
@@ -303,8 +303,9 @@ void ScriptEngine::wait() { · 12 unmodified lines
303 // Process events for the main application thread, allowing invokeMethod calls to pass between threads.303 // Process events for the main application thread, allowing invokeMethod calls to pass between threads.
304 QCoreApplication::processEvents();304 QCoreApplication::processEvents();
305 305
306 // If the final evaluation takes too long, then tell the script engine to stop evaluating306 // If the final evaluation takes too long, then tell the script engine to stop running
307 auto elapsedUsecs = usecTimestampNow() - startedWaiting;307 auto elapsedUsecs = usecTimestampNow() - startedWaiting;
308 static const auto MAX_SCRIPT_EVALUATION_TIME = USECS_PER_SECOND;
308 if (elapsedUsecs > MAX_SCRIPT_EVALUATION_TIME) {309 if (elapsedUsecs > MAX_SCRIPT_EVALUATION_TIME) {
309 workerThread->quit();310 workerThread->quit();
310 311