From 928ed8bd856c41b4fd06982887c35f50bbd79f82 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 11 Jan 2025 13:00:33 +1000 Subject: [PATCH] Web Audio: Enable threading in ma_engine if compiling with -pthread. With this commit, when targeting pthreads with the -pthread, the engine will allow threading with it's internal resource manager. Public issue https://github.com/mackron/miniaudio/issues/855 --- miniaudio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index 5b5d92d0..c270609d 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -75690,8 +75690,8 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng ma_allocation_callbacks_init_copy(&resourceManagerConfig.allocationCallbacks, &pEngine->allocationCallbacks); resourceManagerConfig.pVFS = engineConfig.pResourceManagerVFS; - /* The Emscripten build cannot use threads. */ - #if defined(MA_EMSCRIPTEN) + /* The Emscripten build cannot use threads unless it's targeting pthreads. */ + #if defined(MA_EMSCRIPTEN) && !defined(__EMSCRIPTEN_PTHREADS__) { resourceManagerConfig.jobThreadCount = 0; resourceManagerConfig.flags |= MA_RESOURCE_MANAGER_FLAG_NO_THREADING;