mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 11:49:06 +00: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:
parent
bba33c7ced
commit
fb265b610d
4 changed files with 23 additions and 17 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue