Fix mj_loadXML hang in single-threaded WASM builds
The top-level CMakeLists.txt unconditionally added -pthread for all Emscripten builds, but PTHREAD_POOL_SIZE was only set when MUJOCO_WASM_THREADS=ON. This gave the ST build a live pthread runtime with zero pre-spawned workers, causing CompileMeshesAndTextures to deadlock when it tried to spawn a ThreadPool on the main thread. Fix by making -pthread conditional on MUJOCO_WASM_THREADS. Without -pthread, hardware_concurrency() returns 0 and the existing nthread < 2 guards naturally select the serial compilation path. PiperOrigin-RevId: 900191420 Change-Id: I0481b81fc6f7cccb52c7d7592dcf9dd317b5bad1
This commit is contained in:
committed by
Copybara-Service
parent
e047f1101a
commit
7ac30a39fe
@@ -31,8 +31,6 @@ if(NOT MUJOCO_WASM_FILES)
|
||||
message(FATAL_ERROR "No source files found in codegen/generated/")
|
||||
endif()
|
||||
|
||||
option(MUJOCO_WASM_THREADS "Build with multi-threading support" ON)
|
||||
|
||||
# Set Emscripten linker flags
|
||||
set(EMCC_LINKER_FLAGS
|
||||
"--bind"
|
||||
|
||||
Reference in New Issue
Block a user