From 762c106e19b124241a1b7e2564416ca10b7be3b5 Mon Sep 17 00:00:00 2001 From: gamerforEA Date: Thu, 27 Feb 2020 00:23:06 +0400 Subject: [PATCH] sys_prx_.cpp: Fix RAII locks usage (without local variables they destroyed immediately after construction) --- rpcs3/Emu/Cell/Modules/sys_prx_.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/sys_prx_.cpp b/rpcs3/Emu/Cell/Modules/sys_prx_.cpp index af19e952f1..eb9704a964 100644 --- a/rpcs3/Emu/Cell/Modules/sys_prx_.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_prx_.cpp @@ -35,7 +35,7 @@ error_code sys_prx_load_module(ppu_thread& ppu, vm::cptr path, u64 flags, { sysPrxForUser.warning("sys_prx_load_module(path=%s, flags=0x%x, pOpt=*0x%x)", path, flags, pOpt); - sys_lwmutex_locker(ppu, g_ppu_prx_lwm); + sys_lwmutex_locker lock(ppu, g_ppu_prx_lwm); return _sys_prx_load_module(path, flags, pOpt); } @@ -44,7 +44,7 @@ error_code sys_prx_load_module_by_fd(ppu_thread& ppu, s32 fd, u64 offset, u64 fl { sysPrxForUser.warning("sys_prx_load_module_by_fd(fd=%d, offset=0x%x, flags=0x%x, pOpt=*0x%x)", fd, offset, flags, pOpt); - sys_lwmutex_locker(ppu, g_ppu_prx_lwm); + sys_lwmutex_locker lock(ppu, g_ppu_prx_lwm); return _sys_prx_load_module_by_fd(fd, offset, flags, pOpt); } @@ -53,7 +53,7 @@ error_code sys_prx_load_module_on_memcontainer(ppu_thread& ppu, vm::cptr p { sysPrxForUser.warning("sys_prx_load_module_on_memcontainer(path=%s, mem_ct=0x%x, flags=0x%x, pOpt=*0x%x)", path, mem_ct, flags, pOpt); - sys_lwmutex_locker(ppu, g_ppu_prx_lwm); + sys_lwmutex_locker lock(ppu, g_ppu_prx_lwm); return _sys_prx_load_module_on_memcontainer(path, mem_ct, flags, pOpt); } @@ -62,7 +62,7 @@ error_code sys_prx_load_module_on_memcontainer_by_fd(ppu_thread& ppu, s32 fd, u6 { sysPrxForUser.warning("sys_prx_load_module_on_memcontainer_by_fd(fd=%d, offset=0x%x, mem_ct=0x%x, flags=0x%x, pOpt=*0x%x)", fd, offset, mem_ct, flags, pOpt); - sys_lwmutex_locker(ppu, g_ppu_prx_lwm); + sys_lwmutex_locker lock(ppu, g_ppu_prx_lwm); return _sys_prx_load_module_on_memcontainer_by_fd(fd, offset, mem_ct, flags, pOpt); } @@ -71,7 +71,7 @@ error_code sys_prx_load_module_list(ppu_thread& ppu, s32 count, vm::cpptr { sysPrxForUser.todo("sys_prx_load_module_list(count=%d, path_list=**0x%x, flags=0x%x, pOpt=*0x%x, id_list=*0x%x)", count, path_list, flags, pOpt, id_list); - sys_lwmutex_locker(ppu, g_ppu_prx_lwm); + sys_lwmutex_locker lock(ppu, g_ppu_prx_lwm); return _sys_prx_load_module_list(count, convert_path_list(path_list, count), flags, pOpt, id_list); } @@ -80,7 +80,7 @@ error_code sys_prx_load_module_list_on_memcontainer(ppu_thread& ppu, s32 count, { sysPrxForUser.todo("sys_prx_load_module_list_on_memcontainer(count=%d, path_list=**0x%x, mem_ct=0x%x, flags=0x%x, pOpt=*0x%x, id_list=*0x%x)", count, path_list, mem_ct, flags, pOpt, id_list); - sys_lwmutex_locker(ppu, g_ppu_prx_lwm); + sys_lwmutex_locker lock(ppu, g_ppu_prx_lwm); return _sys_prx_load_module_list_on_memcontainer(count, convert_path_list(path_list, count), mem_ct, flags, pOpt, id_list); } @@ -94,7 +94,7 @@ error_code sys_prx_start_module(ppu_thread& ppu, u32 id, u32 args, vm::ptr return CELL_EINVAL; } - sys_lwmutex_locker(ppu, g_ppu_prx_lwm); + sys_lwmutex_locker lock(ppu, g_ppu_prx_lwm); vm::var opt; opt->size = opt.size(); @@ -127,7 +127,7 @@ error_code sys_prx_stop_module(ppu_thread& ppu, u32 id, u32 args, vm::ptr return CELL_EINVAL; } - sys_lwmutex_locker(ppu, g_ppu_prx_lwm); + sys_lwmutex_locker lock(ppu, g_ppu_prx_lwm); vm::var opt; opt->size = opt.size(); @@ -155,7 +155,7 @@ error_code sys_prx_unload_module(ppu_thread& ppu, u32 id, u64 flags, vm::ptr lib_entry) { sysPrxForUser.warning("sys_prx_register_library(lib_entry=*0x%x)", lib_entry); - sys_lwmutex_locker(ppu, g_ppu_prx_lwm); + sys_lwmutex_locker lock(ppu, g_ppu_prx_lwm); return _sys_prx_register_library(lib_entry); } @@ -173,7 +173,7 @@ error_code sys_prx_unregister_library(ppu_thread& ppu, vm::ptr lib_entry) { sysPrxForUser.warning("sys_prx_unregister_library(lib_entry=*0x%x)", lib_entry); - sys_lwmutex_locker(ppu, g_ppu_prx_lwm); + sys_lwmutex_locker lock(ppu, g_ppu_prx_lwm); return _sys_prx_unregister_library(lib_entry); }