summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qeventloop.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-11 09:29:17 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-11 09:29:17 +0200
commit4ee4fc18b4067b90efa46ca9baba74f53b54d9ec (patch)
treecc68622c9b85992d99a8373ab55471ee821a4ebf /src/corelib/kernel/qeventloop.cpp
parentab28ff2207e8f33754c79793089dbf943d67736d (diff)
parentebb49c66aaf22ed55d62ff7bc3690fce00b7d8ba (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into tqtc/lts-5.15-opensourcev5.15.8-lts-lgpl
Diffstat (limited to 'src/corelib/kernel/qeventloop.cpp')
-rw-r--r--src/corelib/kernel/qeventloop.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index dc53af7018..5d793ce72a 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -50,6 +50,9 @@
#ifdef Q_OS_WASM
#include <emscripten.h>
+#if QT_CONFIG(thread)
+#include <emscripten/threading.h>
+#endif
#endif
QT_BEGIN_NAMESPACE
@@ -295,6 +298,9 @@ void QEventLoop::exit(int returnCode)
// QEventLoop::exec() never returns in emscripten. We implement approximate behavior here.
// QTBUG-70185
if (threadData->loopLevel == 1) {
+#if QT_CONFIG(thread)
+ if (emscripten_is_main_browser_thread())
+#endif
emscripten_force_exit(returnCode);
} else {
d->inExec = false;