Details
-
Technical task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
Description
We should be able to support async library loading under any one of the following conditions:
- Asyncify is enabled (Qt can block the main thread)
- The load() call is being made on a secondary thread (which can be blocked)
- Async load API is used (private or public) (no need to block)
However, there are issues which combining asyncify with dynamic linking and multithreading with dynamic linking. This makes using an async API the most via option.
emscripten_dlopen() itself is async with a callback. That can be transformed into a blocking call using the standard QEventLoop::exec() approach.
QTBUG-124884 tracks the addition of public API to QLibrary. For this task we can start with a private API.
The implementation should handle the case where dlopen() is called more than once for the same library, before the first load has completed. (This is not currently handled by Emscripten).