From 7514e533851f150f093d2cc551dc3788e3314573 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Fri, 6 Mar 2020 07:09:17 +0300 Subject: [PATCH] Fix SPRX/firmware installation (use a mutex) --- rpcs3/Emu/System.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 2626448770..24d99fd14f 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -980,6 +980,8 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool atomic_t fnext = 0; + shared_mutex sprx_mtx; + named_thread_group workers("SPRX Worker ", GetMaxThreads(), [&] { for (std::size_t func_i = fnext++; func_i < file_queue.size(); func_i = fnext++) @@ -1001,9 +1003,13 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool if (obj == elf_error::ok) { + std::unique_lock lock(sprx_mtx); + if (auto prx = ppu_load_prx(obj, path)) { + lock.unlock(); ppu_initialize(*prx); + lock.lock(); ppu_unload_prx(*prx); g_progr_fdone++; continue;