From 8e5a03f17126db1f5b857746851428965adef98d Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 29 Feb 2020 15:35:53 +0300 Subject: [PATCH] Use named_thread_group in rsx_cache.h --- rpcs3/Emu/RSX/rsx_cache.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/rpcs3/Emu/RSX/rsx_cache.h b/rpcs3/Emu/RSX/rsx_cache.h index bf650a8d1e..5498d794f6 100644 --- a/rpcs3/Emu/RSX/rsx_cache.h +++ b/rpcs3/Emu/RSX/rsx_cache.h @@ -3,6 +3,7 @@ #include "Utilities/hash.h" #include "Utilities/File.h" #include "Utilities/lockless.h" +#include "Utilities/Thread.h" #include "Emu/Memory/vm.h" #include "gcm_enums.h" #include "Common/ProgramStateCache.h" @@ -512,13 +513,10 @@ namespace rsx } else { - std::vector worker_threads(nb_workers); - - // Start workers - for (u32 i = 0; i < nb_workers; i++) + named_thread_group workers("RSX Worker ", nb_workers, [&]() { - worker_threads[i] = std::thread(worker, entry_count); - } + worker(entry_count); + }); u32 current_progress = 0; u32 last_update_progress = 0; @@ -536,11 +534,6 @@ namespace rsx dlg->inc_value(step, processed_since_last_update); } } - - for (std::thread& worker_thread : worker_threads) - { - worker_thread.join(); - } } }