summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmeventdispatcher.cpp
Commit message (Collapse)AuthorAgeFilesLines
* wasm: Fix source code comment typosJonas Kvinge2021-10-121-1/+1
| | | | | Change-Id: I9b2b76c01880c7bb515fdc1a6c4ef1f0bcf6be95 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: add DialogExec hack back with warningMorten Sørvig2021-08-191-0/+10
| | | | | | | | | | | | | | | Previously, this was implemented in QEventLoop. By moving it to the event dispatcher we can target the warning message better and provide a suggested workaround for the dialog case. The behavior is the same as before: call emscripten_sleep(), which throws a Javascript exception and returns control to the browser while leaking the content of the stack. Pick-to: 6.2 Change-Id: I2979fe4fe5923c27713e85b6725614b60a693e93 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* wasm: don’t deadlock on event processingMorten Johan Sørvig2020-11-041-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | emscripten_async_run_in_main_runtime_thread_ schedules an async call on the on the main thread. However, the calls are ordered, also in respect to _synchronous_ calls to the main thread (for example those made during file write/flush). Making a synchronous call from a secondary thread may then cause Emscripten to service previously scheduled async calls during the synchronous call. This can cause a deadlock if: - a secondary thread makes a sync call while holding a lock, and - a previously scheduled async call attempt to acquire the same lock on the main thread. (See https://github.com/emscripten-core/emscripten/issues/10155 for sample code) Avoid this case by adding a second zero-timer async call; this way Qt should process events when the main thread becomes idle. Change-Id: I221fe4e25bbb1a56627e63c3d1809e40ccefb030 Pick-to: 5.15 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Get rid of hasPendingEvents() and flush()Lars Knoll2020-09-061-1/+3
| | | | | | | They are unused. Change-Id: I77383f2be45551401ed9c2f88285511134cc8b0d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* wasm: do not try to resume main thread if mainloop has not started yetLorn Potter2020-04-141-1/+2
| | | | | | | (cherry picked from commit d928beb024c240b37d35d2c53f25648c99a484b4) Fixes: QTBUG-83293 Change-Id: Ibd891629d1d023e47d196dd60821cc5c583a178d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: guard nonthreaded builds from using threading.hLorn Potter2020-02-181-0/+2
| | | | | Change-Id: Ib5cd8afc4822cc89371d184ee5645ed8f496c8b0 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Wasm: Support event loop wakeup from secondary threadsMorten Johan Sørvig2020-01-121-0/+23
| | | | | | | | | | | | | | | | | | | | Minimal fix for the missing wakeup issue, in leu of a new event loop implementation. So far, emscripten_async_run_in_main_runtime_thread_ looks to be our option for scheduling calls on the main thread. This function is available on emsdk 1.38.22 and higher. Requires making from QEventDispatcherUNIX::wakeUp() non-final. The future event dispatcher implementation will not inherit QEventDispatcherUNIX, so this is a temporary change. Fixes: QTBUG-75793 Task-number: QTBUG-76007 Change-Id: Ie6f6ee6f7674206fc0673a4fe866ac614432ab65 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* WebAssembly for QtBaseMorten Johan Sørvig2018-08-301-0/+181
This is the squashed diff from wip/webassembly to dev. Done-with: Peng Wu <peng.wu@intopalo.com> Done-with: Sami Enne <sami.enne@intopalo.com> Done-with: Morten Johan Sørvig <morten.sorvig@qt.io> Started-by: Andrew Knight <andrew.knight@intopalo.com> Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>