QT_WASM_PTHREAD_POOL_SIZE

WebAssembly 内部线程池的大小。

该属性于 Qt 6.2.4 版本中引入。

注意:该 属性处于技术预览阶段,未来版本中可能会发生变化。

注意: 仅当目标平台为 WebAssembly 时,才会使用此 属性。

指定在应用程序启动时要创建的 WebWorker(线程)数量。Qt 默认分配一个大小为 4 的线程池。 这意味着应用程序可以在主线程之外额外使用 4 个线程,而无需承担创建新 Web Worker 的额外开销——如果由主线程创建该 Web Worker 并调用 join() 方法,却未先将控制权交还给事件循环,则可能会导致死锁。该设置对应于 Emscripten 编译器中的 PTHREAD_POOL_SIZE 参数。

有关更多信息,请参阅Pthreads 支持。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.