stratosphere: use SdkMutex/SdkRecursiveMutex over Mutex

This commit is contained in:
Michael Scire
2021-09-29 22:52:50 -07:00
parent a4fe1bb5d8
commit 41ab4c2c68
70 changed files with 188 additions and 645 deletions

View File

@@ -23,15 +23,19 @@ namespace ams::mitm::settings {
namespace {
os::Mutex g_firmware_version_lock(false);
bool g_cached_firmware_version;
settings::FirmwareVersion g_firmware_version;
settings::FirmwareVersion g_ams_firmware_version;
constinit os::SdkMutex g_firmware_version_lock;
constinit bool g_cached_firmware_version;
constinit settings::FirmwareVersion g_firmware_version;
constinit settings::FirmwareVersion g_ams_firmware_version;
void CacheFirmwareVersion() {
if (AMS_LIKELY(g_cached_firmware_version)) {
return;
}
std::scoped_lock lk(g_firmware_version_lock);
if (AMS_LIKELY(g_cached_firmware_version)) {
if (AMS_UNLIKELY(g_cached_firmware_version)) {
return;
}