summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qeventloop.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qeventloop.cpp')
-rw-r--r--src/corelib/kernel/qeventloop.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index 5a5dfb06aa..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
@@ -118,8 +121,8 @@ QEventLoop::~QEventLoop()
/*!
- Processes pending events that match \a flags until there are no
- more events to process. Returns \c true if pending events were handled;
+ Processes some pending events that match \a flags.
+ Returns \c true if pending events were handled;
otherwise returns \c false.
This function is especially useful if you have a long running
@@ -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;