mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-11 17:28:36 +12:00
Fix deadlock in games_config
This commit is contained in:
parent
ea3a73b598
commit
bf190fd3d8
2 changed files with 9 additions and 4 deletions
|
@ -66,7 +66,7 @@ bool games_config::add_game(const std::string& key, const std::string& path)
|
||||||
|
|
||||||
if (m_save_on_dirty)
|
if (m_save_on_dirty)
|
||||||
{
|
{
|
||||||
return save();
|
return save_nl();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -90,10 +90,8 @@ bool games_config::add_external_hdd_game(const std::string& key, std::string& pa
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool games_config::save()
|
bool games_config::save_nl()
|
||||||
{
|
{
|
||||||
std::lock_guard lock(m_mutex);
|
|
||||||
|
|
||||||
YAML::Emitter out;
|
YAML::Emitter out;
|
||||||
out << m_games;
|
out << m_games;
|
||||||
|
|
||||||
|
@ -109,6 +107,12 @@ bool games_config::save()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool games_config::save()
|
||||||
|
{
|
||||||
|
std::lock_guard lock(m_mutex);
|
||||||
|
return save_nl();
|
||||||
|
}
|
||||||
|
|
||||||
void games_config::load()
|
void games_config::load()
|
||||||
{
|
{
|
||||||
std::lock_guard lock(m_mutex);
|
std::lock_guard lock(m_mutex);
|
||||||
|
|
|
@ -21,6 +21,7 @@ public:
|
||||||
bool save();
|
bool save();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool save_nl();
|
||||||
void load();
|
void load();
|
||||||
|
|
||||||
std::map<std::string, std::string> m_games;
|
std::map<std::string, std::string> m_games;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue