summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame
diff options
context:
space:
mode:
author Justin Kerk <dopefishjustin@gmail.com>2021-12-19 19:30:09 -0500
committer Justin Kerk <dopefishjustin@gmail.com>2021-12-19 19:30:09 -0500
commitd0374c5d178a5005f2a6dc594971347d605d38af (patch)
tree25cb1dd7cc269ae6a73ec8b270883f10d8150dec /src/frontend/mame
parent039e7448ce8ae4cd637a20704221ee4768112492 (diff)
Fix lockup loading UI with Emscripten builds that don't support threading
Diffstat (limited to 'src/frontend/mame')
-rw-r--r--src/frontend/mame/ui/systemlist.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/frontend/mame/ui/systemlist.cpp b/src/frontend/mame/ui/systemlist.cpp
index 258df48b0b2..a05ebeecc12 100644
--- a/src/frontend/mame/ui/systemlist.cpp
+++ b/src/frontend/mame/ui/systemlist.cpp
@@ -20,6 +20,7 @@
#include <algorithm>
#include <cassert>
+#include <functional>
#include <locale>
#include <string_view>
@@ -32,7 +33,11 @@ void system_list::cache_data(ui_options const &options)
if (!m_started)
{
m_started = true;
+#if defined(__EMSCRIPTEN__)
+ std::invoke(
+#else
m_thread = std::make_unique<std::thread>(
+#endif
[this, datpath = std::string(options.history_path()), titles = std::string(options.system_names())]
{
do_cache_data(datpath, titles);