mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-11 09:18:40 +12:00
cellSaveData: Fixed savedata lock after fmt::throw_exception
This commit is contained in:
parent
d58f52ff31
commit
b21b4faca8
1 changed files with 6 additions and 3 deletions
|
@ -90,7 +90,10 @@ namespace
|
||||||
|
|
||||||
vm::gvar<savedata_context> g_savedata_context;
|
vm::gvar<savedata_context> g_savedata_context;
|
||||||
|
|
||||||
std::mutex g_savedata_mutex;
|
struct savedata_mutex
|
||||||
|
{
|
||||||
|
semaphore<> mutex;
|
||||||
|
};
|
||||||
|
|
||||||
static std::vector<SaveDataEntry> get_save_entries(const std::string& base_dir, const std::string& prefix)
|
static std::vector<SaveDataEntry> get_save_entries(const std::string& base_dir, const std::string& prefix)
|
||||||
{
|
{
|
||||||
|
@ -150,7 +153,7 @@ static std::vector<SaveDataEntry> get_save_entries(const std::string& base_dir,
|
||||||
|
|
||||||
static error_code select_and_delete(ppu_thread& ppu)
|
static error_code select_and_delete(ppu_thread& ppu)
|
||||||
{
|
{
|
||||||
std::unique_lock lock(g_savedata_mutex, std::try_to_lock);
|
std::unique_lock lock(g_fxo->get<savedata_mutex>()->mutex, std::try_to_lock);
|
||||||
|
|
||||||
if (!lock)
|
if (!lock)
|
||||||
{
|
{
|
||||||
|
@ -537,7 +540,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
|
||||||
return {CELL_SAVEDATA_ERROR_PARAM, std::to_string(ecode)};
|
return {CELL_SAVEDATA_ERROR_PARAM, std::to_string(ecode)};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_lock lock(g_savedata_mutex, std::try_to_lock);
|
std::unique_lock lock(g_fxo->get<savedata_mutex>()->mutex, std::try_to_lock);
|
||||||
|
|
||||||
if (!lock)
|
if (!lock)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue