mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-04-22 12:34:47 +00:00
std::scoped_lock<> -> std::scoped_lock
This commit is contained in:
parent
9b21262085
commit
cf7412df06
3 changed files with 20 additions and 20 deletions
|
@ -145,7 +145,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result InitializeContentManager() {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
/* Already initialized. */
|
||||
if (g_initialized) {
|
||||
|
@ -256,7 +256,7 @@ namespace ams::ncm::impl {
|
|||
|
||||
void FinalizeContentManager() {
|
||||
{
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
for (size_t i = 0; i < MaxContentStorageEntries; i++) {
|
||||
ContentStorageEntry* entry = &g_content_storage_entries[i];
|
||||
|
@ -281,7 +281,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result CreateContentStorage(StorageId storage_id) {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
if (storage_id == StorageId::None || static_cast<u8>(storage_id) == 6) {
|
||||
return ResultUnknownStorage();
|
||||
|
@ -306,7 +306,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result VerifyContentStorage(StorageId storage_id) {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
if (storage_id == StorageId::None || static_cast<u8>(storage_id) == 6) {
|
||||
return ResultUnknownStorage();
|
||||
|
@ -334,7 +334,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result OpenContentStorage(std::shared_ptr<IContentStorage>* out, StorageId storage_id) {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
if (storage_id == StorageId::None || static_cast<u8>(storage_id) == 6) {
|
||||
return ResultUnknownStorage();
|
||||
|
@ -378,7 +378,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result CloseContentStorageForcibly(StorageId storage_id) {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
if (storage_id == StorageId::None) {
|
||||
return ResultUnknownStorage();
|
||||
|
@ -402,7 +402,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result ActivateContentStorage(StorageId storage_id) {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
if (storage_id == StorageId::None || static_cast<u8>(storage_id) == 6) {
|
||||
return ResultUnknownStorage();
|
||||
|
@ -460,7 +460,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result InactivateContentStorage(StorageId storage_id) {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
if (storage_id == StorageId::None || static_cast<u8>(storage_id) == 6) {
|
||||
return ResultUnknownStorage();
|
||||
|
@ -484,7 +484,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result CreateContentMetaDatabase(StorageId storage_id) {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
if (storage_id == StorageId::None || storage_id == StorageId::GameCard || static_cast<u8>(storage_id) == 6) {
|
||||
return ResultUnknownStorage();
|
||||
|
@ -517,7 +517,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result VerifyContentMetaDatabase(StorageId storage_id) {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
if (storage_id == StorageId::GameCard) {
|
||||
return ResultSuccess();
|
||||
|
@ -556,7 +556,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result OpenContentMetaDatabase(std::shared_ptr<IContentMetaDatabase>* out, StorageId storage_id) {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
if (storage_id == StorageId::None || static_cast<u8>(storage_id) == 6) {
|
||||
return ResultUnknownStorage();
|
||||
|
@ -600,7 +600,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result CloseContentMetaDatabaseForcibly(StorageId storage_id) {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
if (storage_id == StorageId::None) {
|
||||
return ResultUnknownStorage();
|
||||
|
@ -631,7 +631,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result CleanupContentMetaDatabase(StorageId storage_id) {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
if (storage_id == StorageId::None || static_cast<u8>(storage_id) == 6) {
|
||||
return ResultUnknownStorage();
|
||||
|
@ -648,7 +648,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result ActivateContentMetaDatabase(StorageId storage_id) {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
if (storage_id == StorageId::None || static_cast<u8>(storage_id) == 6) {
|
||||
return ResultUnknownStorage();
|
||||
|
@ -684,7 +684,7 @@ namespace ams::ncm::impl {
|
|||
}
|
||||
|
||||
Result InactivateContentMetaDatabase(StorageId storage_id) {
|
||||
std::scoped_lock<os::Mutex> lk(g_mutex);
|
||||
std::scoped_lock lk(g_mutex);
|
||||
|
||||
if (storage_id == StorageId::None || static_cast<u8>(storage_id) == 6) {
|
||||
return ResultUnknownStorage();
|
||||
|
|
|
@ -429,7 +429,7 @@ namespace ams::ncm {
|
|||
R_TRY(this->EnsureEnabled());
|
||||
|
||||
{
|
||||
std::scoped_lock<os::Mutex> lk(this->rights_id_cache->mutex);
|
||||
std::scoped_lock lk(this->rights_id_cache->mutex);
|
||||
|
||||
/* Attempt to locate the content id in the cache. */
|
||||
for (size_t i = 0; i < impl::RightsIdCache::MaxEntries; i++) {
|
||||
|
@ -454,7 +454,7 @@ namespace ams::ncm {
|
|||
R_TRY(fsGetRightsIdAndKeyGenerationByPath(common_path, &key_generation, &rights_id));
|
||||
|
||||
{
|
||||
std::scoped_lock<os::Mutex> lk(this->rights_id_cache->mutex);
|
||||
std::scoped_lock lk(this->rights_id_cache->mutex);
|
||||
impl::RightsIdCache::Entry* eviction_candidate = &this->rights_id_cache->entries[0];
|
||||
|
||||
/* Find a suitable existing entry to store our new one at. */
|
||||
|
@ -598,7 +598,7 @@ namespace ams::ncm {
|
|||
R_TRY(this->EnsureEnabled());
|
||||
|
||||
{
|
||||
std::scoped_lock<os::Mutex> lk(this->rights_id_cache->mutex);
|
||||
std::scoped_lock lk(this->rights_id_cache->mutex);
|
||||
|
||||
/* Attempt to locate the content id in the cache. */
|
||||
for (size_t i = 0; i < impl::RightsIdCache::MaxEntries; i++) {
|
||||
|
@ -623,7 +623,7 @@ namespace ams::ncm {
|
|||
R_TRY(fsGetRightsIdAndKeyGenerationByPath(common_path, &key_generation, &rights_id));
|
||||
|
||||
{
|
||||
std::scoped_lock<os::Mutex> lk(this->rights_id_cache->mutex);
|
||||
std::scoped_lock lk(this->rights_id_cache->mutex);
|
||||
impl::RightsIdCache::Entry* eviction_candidate = &this->rights_id_cache->entries[0];
|
||||
|
||||
/* Find a suitable existing entry to store our new one at. */
|
||||
|
|
|
@ -226,7 +226,7 @@ namespace ams::ncm::fs {
|
|||
static os::Mutex g_mount_index_lock;
|
||||
|
||||
MountName CreateUniqueMountName() {
|
||||
std::scoped_lock<os::Mutex> lk(g_mount_index_lock);
|
||||
std::scoped_lock lk(g_mount_index_lock);
|
||||
MountName mount_name;
|
||||
g_mount_index++;
|
||||
snprintf(mount_name.name, sizeof(MountName), "@ncm%08x", g_mount_index);
|
||||
|
|
Loading…
Add table
Reference in a new issue