Disable multithreading on the Emscripten target as it is not currently supported. Fixes e.g. drivers using discrete audio components. [Justin Kerk]

This commit is contained in:
Justin Kerk 2018-03-06 07:39:05 +00:00
parent 7c3a6903f1
commit 1f80e58a10
2 changed files with 6 additions and 0 deletions

View File

@ -153,6 +153,7 @@ end
.. " -s DISABLE_EXCEPTION_CATCHING=2"
.. " -s EXCEPTION_CATCHING_WHITELIST='[\"__ZN15running_machine17start_all_devicesEv\",\"__ZN12cli_frontend7executeEiPPc\"]'"
.. " -s EXPORTED_FUNCTIONS=\"['_main', '_malloc', '__ZN15running_machine30emscripten_get_running_machineEv', '__ZN15running_machine17emscripten_get_uiEv', '__ZN15running_machine20emscripten_get_soundEv', '__ZN15mame_ui_manager12set_show_fpsEb', '__ZNK15mame_ui_manager8show_fpsEv', '__ZN13sound_manager4muteEbh', '_SDL_PauseAudio', '_SDL_SendKeyboardKey', '__ZN15running_machine15emscripten_saveEPKc', '__ZN15running_machine15emscripten_loadEPKc', '__ZN15running_machine21emscripten_hard_resetEv', '__ZN15running_machine21emscripten_soft_resetEv', '__ZN15running_machine15emscripten_exitEv']\""
.. " -s EXTRA_EXPORTED_RUNTIME_METHODS=\"['cwrap']\""
.. " --pre-js " .. _MAKE.esc(MAME_DIR) .. "src/osd/modules/sound/js_sound.js"
.. " --post-js " .. _MAKE.esc(MAME_DIR) .. "scripts/resources/emscripten/emscripten_post.js"
.. " --embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx/chains@bgfx/chains"

View File

@ -87,8 +87,13 @@ static void spin_while_not(const volatile _AtomType * volatile atom, const _Main
int osd_get_num_processors(void)
{
#if defined(SDLMAME_EMSCRIPTEN)
// multithreading is not supported at this time
return 1;
#else
// max out at 4 for now since scaling above that seems to do poorly
return std::min(std::thread::hardware_concurrency(), 4U);
#endif
}
//============================================================