Merge pull request #10054 from JosJuice/android-game-cache-lock

Android: Reduce gameFileCache lock contention
This commit is contained in:
Mai M
2021-08-27 10:15:25 -04:00
committed by GitHub
6 changed files with 67 additions and 31 deletions

View File

@ -4,6 +4,7 @@
#include "UICommon/GameFileCache.h"
#include <algorithm>
#include <atomic>
#include <cstddef>
#include <functional>
#include <list>
@ -202,7 +203,7 @@ bool GameFileCache::UpdateAdditionalMetadata(std::shared_ptr<GameFile>* game_fil
if (custom_cover_changed)
copy->CustomCoverCommit();
*game_file = std::move(copy);
std::atomic_store(game_file, std::move(copy));
return true;
}