mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Android: Don't hold gameFileCache lock during updateAdditionalMetadata
It seems like we spend a lot of the game list scanning time in updateAdditionalMetadata, which I suppose makes sense considering how many different files that function attempts to open. With the addition of just one little atomic operation, we can make it safe to call updateAdditionalMetadata without holding a lock.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user