diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-10-22 11:58:47 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-11-04 10:17:09 +0000 |
commit | 4035fdd820d75a1145f4b5320c14664a5cecc2cb (patch) | |
tree | 5595efd705ad79fa405853a5fb1e89b34202bc1a /tests/benchmarks/corelib/tools | |
parent | f9e45287d820b8af2d40050288034c7ba8262d26 (diff) |
wasm: don’t deadlock on event processing
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>
Diffstat (limited to 'tests/benchmarks/corelib/tools')
0 files changed, 0 insertions, 0 deletions