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

@@ -30,13 +30,13 @@ namespace ams::lmem::impl {
public:
explicit ScopedHeapLock(HeapHandle h) : handle(h) {
if (this->handle->option & CreateOption_ThreadSafe) {
os::LockMutex(std::addressof(this->handle->mutex));
os::LockSdkMutex(std::addressof(this->handle->mutex));
}
}
~ScopedHeapLock() {
if (this->handle->option & CreateOption_ThreadSafe) {
os::UnlockMutex(std::addressof(this->handle->mutex));
os::UnlockSdkMutex(std::addressof(this->handle->mutex));
}
}
};

View File

@@ -427,6 +427,7 @@ namespace ams::lmem::impl {
const s32 abs_alignment = std::abs(alignment);
AMS_ASSERT((abs_alignment & (abs_alignment - 1)) == 0);
AMS_ASSERT(MinimumAlignment <= static_cast<size_t>(abs_alignment));
AMS_UNUSED(abs_alignment);
/* Fix size to be correctly aligned. */
if (size == 0) {