History

V8 event loop handling

Ada committed 7 months ago

Commit e266f611 parent 384cf355 files · +75 −0Browse files

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

Unified · Split

libraries/script-engine/src/ScriptManager.cpp+3−0
@@ -550,6 +550,7 @@ void ScriptManager::waitTillDoneRunning(bool shutdown) { · 549 unmodified lines
550 // if they access Settings or Menu in any of their shutdown code. So:550 // if they access Settings or Menu in any of their shutdown code. So:
551 // Process events for this thread, allowing invokeMethod calls to pass between threads.551 // Process events for this thread, allowing invokeMethod calls to pass between threads.
552 QCoreApplication::processEvents();552 QCoreApplication::processEvents();
553 _engine->processEvents();
553 }554 }
554 555
555 // Avoid a pure busy wait556 // Avoid a pure busy wait
@@ -1068,6 +1069,7 @@ void ScriptManager::run() { · 512 unmodified lines
1068 } else {1069 } else {
1069 QCoreApplication::processEvents();1070 QCoreApplication::processEvents();
1070 }1071 }
1072 _engine->processEvents();
1071 processedEvents = true;1073 processedEvents = true;
1072 _engine->perManagerLoopIterationCleanup();1074 _engine->perManagerLoopIterationCleanup();
1073 }1075 }
@@ -1103,6 +1105,7 @@ void ScriptManager::run() { · 29 unmodified lines
1103 if (!processedEvents) {1105 if (!processedEvents) {
1104 PROFILE_RANGE(script, "processEvents");1106 PROFILE_RANGE(script, "processEvents");
1105 QCoreApplication::processEvents();1107 QCoreApplication::processEvents();
1108 _engine->processEvents();
1106 }1109 }
1107 1110
1108 if (_isFinished) {1111 if (_isFinished) {