Skip to content

Commit

Permalink
cellSysCache: Global hdd1 lock
Browse files Browse the repository at this point in the history
Take advantage of recursive locking.
  • Loading branch information
elad335 committed Sep 16, 2020
1 parent ebfaeb7 commit 7f66df6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rpcs3/Emu/Cell/Modules/cellSysCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ struct syscache_info
// Poison opened files in /dev_hdd1 to return CELL_EIO on access
if (remove_root)
{
std::lock_guard lock(g_mp_sys_dev_hdd1.mutex);

idm::select<lv2_fs_object, lv2_file>([](u32 id, lv2_file& file)
{
if (std::memcmp("/dev_hdd1", file.name.data(), 9) == 0)
Expand Down Expand Up @@ -108,6 +106,7 @@ error_code cellSysCacheClear()
// Clear existing cache
if (!cache->cache_id.empty())
{
std::lock_guard lock0(g_mp_sys_dev_hdd1.mutex);
cache->clear(false);
}

Expand Down Expand Up @@ -149,6 +148,8 @@ error_code cellSysCacheMount(vm::ptr<CellSysCacheParam> param)
return not_an_error(CELL_SYSCACHE_RET_OK_RELAYED);
}

std::lock_guard lock0(g_mp_sys_dev_hdd1.mutex);

// Clear existing cache
if (!cache->cache_id.empty())
{
Expand Down

0 comments on commit 7f66df6

Please sign in to comment.