os: adopt nintendo ReaderWriter naming over ReadWrite
This commit is contained in:
@@ -101,7 +101,7 @@ namespace ams::os::impl {
|
||||
|
||||
}
|
||||
|
||||
void InternalReadWriteBusyMutexImpl::AcquireReadLock() {
|
||||
void InternalReaderWriterBusyMutexImpl::AcquireReadLock() {
|
||||
/* Get the thread local region. */
|
||||
auto * const tlr = svc::GetThreadLocalRegion();
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
void InternalReadWriteBusyMutexImpl::ReleaseReadLock() {
|
||||
void InternalReaderWriterBusyMutexImpl::ReleaseReadLock() {
|
||||
/* Release the read lock. */
|
||||
{
|
||||
/* Get pointer to our value. */
|
||||
@@ -183,7 +183,7 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
void InternalReadWriteBusyMutexImpl::AcquireWriteLock() {
|
||||
void InternalReaderWriterBusyMutexImpl::AcquireWriteLock() {
|
||||
/* Get the thread local region. */
|
||||
auto * const tlr = svc::GetThreadLocalRegion();
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
void InternalReadWriteBusyMutexImpl::ReleaseWriteLock() {
|
||||
void InternalReaderWriterBusyMutexImpl::ReleaseWriteLock() {
|
||||
/* Check pre-conditions. */
|
||||
AMS_ABORT_UNLESS(IsWriteLocked(m_value));
|
||||
|
||||
|
||||
@@ -19,40 +19,40 @@
|
||||
#if defined(ATMOSPHERE_OS_HORIZON)
|
||||
#include "os_rw_lock_target_impl.os.horizon.hpp"
|
||||
#else
|
||||
#error "Unknown OS for os::ReadWriteLockTargetImpl"
|
||||
#error "Unknown OS for os::ReaderWriterLockTargetImpl"
|
||||
#endif
|
||||
|
||||
namespace ams::os::impl {
|
||||
|
||||
static_assert(alignof(ReadWriteLockType) == sizeof(u64) || alignof(ReadWriteLockType) == sizeof(u32));
|
||||
constexpr inline bool IsReadWriteLockGuaranteedAlignment = alignof(ReadWriteLockType) == sizeof(u64);
|
||||
static_assert(alignof(ReaderWriterLockType) == sizeof(u64) || alignof(ReaderWriterLockType) == sizeof(u32));
|
||||
constexpr inline bool IsReaderWriterLockGuaranteedAlignment = alignof(ReaderWriterLockType) == sizeof(u64);
|
||||
|
||||
struct ReadWriteLockCounter {
|
||||
struct ReaderWriterLockCounter {
|
||||
using ReadLockCount = util::BitPack32::Field< 0, BITSIZEOF(u16) - 1, u32>;
|
||||
using WriteLocked = util::BitPack32::Field< ReadLockCount::Next, 1, u32>;
|
||||
using ReadLockWaiterCount = util::BitPack32::Field< WriteLocked::Next, BITSIZEOF(u8), u32>;
|
||||
using WriteLockWaiterCount = util::BitPack32::Field<ReadLockWaiterCount::Next, BITSIZEOF(u8), u32>;
|
||||
};
|
||||
static_assert(ReadWriteLockCounter::WriteLockWaiterCount::Next == BITSIZEOF(u32));
|
||||
static_assert(ReaderWriterLockCounter::WriteLockWaiterCount::Next == BITSIZEOF(u32));
|
||||
|
||||
ALWAYS_INLINE void ClearReadLockCount(ReadWriteLockType::LockCount &lc) {
|
||||
lc.counter.Set<ReadWriteLockCounter::ReadLockCount>(0);
|
||||
ALWAYS_INLINE void ClearReadLockCount(ReaderWriterLockType::LockCount &lc) {
|
||||
lc.counter.Set<ReaderWriterLockCounter::ReadLockCount>(0);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void ClearWriteLocked(ReadWriteLockType::LockCount &lc) {
|
||||
lc.counter.Set<ReadWriteLockCounter::WriteLocked>(0);
|
||||
ALWAYS_INLINE void ClearWriteLocked(ReaderWriterLockType::LockCount &lc) {
|
||||
lc.counter.Set<ReaderWriterLockCounter::WriteLocked>(0);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void ClearReadLockWaiterCount(ReadWriteLockType::LockCount &lc) {
|
||||
lc.counter.Set<ReadWriteLockCounter::ReadLockWaiterCount>(0);
|
||||
ALWAYS_INLINE void ClearReadLockWaiterCount(ReaderWriterLockType::LockCount &lc) {
|
||||
lc.counter.Set<ReaderWriterLockCounter::ReadLockWaiterCount>(0);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void ClearWriteLockWaiterCount(ReadWriteLockType::LockCount &lc) {
|
||||
lc.counter.Set<ReadWriteLockCounter::WriteLockWaiterCount>(0);
|
||||
ALWAYS_INLINE void ClearWriteLockWaiterCount(ReaderWriterLockType::LockCount &lc) {
|
||||
lc.counter.Set<ReaderWriterLockCounter::WriteLockWaiterCount>(0);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void ClearWriteLockCount(ReadWriteLockType *rw_lock) {
|
||||
if constexpr (IsReadWriteLockGuaranteedAlignment) {
|
||||
ALWAYS_INLINE void ClearWriteLockCount(ReaderWriterLockType *rw_lock) {
|
||||
if constexpr (IsReaderWriterLockGuaranteedAlignment) {
|
||||
rw_lock->lock_count.aligned.write_lock_count = 0;
|
||||
} else {
|
||||
if (reinterpret_cast<uintptr_t>(std::addressof(rw_lock->lock_count)) & sizeof(u32)) {
|
||||
@@ -63,8 +63,8 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
ALWAYS_INLINE ReadWriteLockType::LockCount &GetLockCount(ReadWriteLockType *rw_lock) {
|
||||
if constexpr (IsReadWriteLockGuaranteedAlignment) {
|
||||
ALWAYS_INLINE ReaderWriterLockType::LockCount &GetLockCount(ReaderWriterLockType *rw_lock) {
|
||||
if constexpr (IsReaderWriterLockGuaranteedAlignment) {
|
||||
return rw_lock->lock_count.aligned.c;
|
||||
} else {
|
||||
if (reinterpret_cast<uintptr_t>(std::addressof(rw_lock->lock_count)) & sizeof(u32)) {
|
||||
@@ -75,8 +75,8 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
ALWAYS_INLINE const ReadWriteLockType::LockCount &GetLockCount(const ReadWriteLockType *rw_lock) {
|
||||
if constexpr (IsReadWriteLockGuaranteedAlignment) {
|
||||
ALWAYS_INLINE const ReaderWriterLockType::LockCount &GetLockCount(const ReaderWriterLockType *rw_lock) {
|
||||
if constexpr (IsReaderWriterLockGuaranteedAlignment) {
|
||||
return rw_lock->lock_count.aligned.c;
|
||||
} else {
|
||||
if (reinterpret_cast<uintptr_t>(std::addressof(rw_lock->lock_count)) & sizeof(u32)) {
|
||||
@@ -87,24 +87,24 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
ALWAYS_INLINE u32 GetReadLockCount(const ReadWriteLockType::LockCount &lc) {
|
||||
return lc.counter.Get<ReadWriteLockCounter::ReadLockCount>();
|
||||
ALWAYS_INLINE u32 GetReadLockCount(const ReaderWriterLockType::LockCount &lc) {
|
||||
return lc.counter.Get<ReaderWriterLockCounter::ReadLockCount>();
|
||||
}
|
||||
|
||||
ALWAYS_INLINE u32 GetWriteLocked(const ReadWriteLockType::LockCount &lc) {
|
||||
return lc.counter.Get<ReadWriteLockCounter::WriteLocked>();
|
||||
ALWAYS_INLINE u32 GetWriteLocked(const ReaderWriterLockType::LockCount &lc) {
|
||||
return lc.counter.Get<ReaderWriterLockCounter::WriteLocked>();
|
||||
}
|
||||
|
||||
ALWAYS_INLINE u32 GetReadLockWaiterCount(const ReadWriteLockType::LockCount &lc) {
|
||||
return lc.counter.Get<ReadWriteLockCounter::ReadLockWaiterCount>();
|
||||
ALWAYS_INLINE u32 GetReadLockWaiterCount(const ReaderWriterLockType::LockCount &lc) {
|
||||
return lc.counter.Get<ReaderWriterLockCounter::ReadLockWaiterCount>();
|
||||
}
|
||||
|
||||
ALWAYS_INLINE u32 GetWriteLockWaiterCount(const ReadWriteLockType::LockCount &lc) {
|
||||
return lc.counter.Get<ReadWriteLockCounter::WriteLockWaiterCount>();
|
||||
ALWAYS_INLINE u32 GetWriteLockWaiterCount(const ReaderWriterLockType::LockCount &lc) {
|
||||
return lc.counter.Get<ReaderWriterLockCounter::WriteLockWaiterCount>();
|
||||
}
|
||||
|
||||
ALWAYS_INLINE u32 &GetWriteLockCount(ReadWriteLockType &rw_lock) {
|
||||
if constexpr (IsReadWriteLockGuaranteedAlignment) {
|
||||
ALWAYS_INLINE u32 &GetWriteLockCount(ReaderWriterLockType &rw_lock) {
|
||||
if constexpr (IsReaderWriterLockGuaranteedAlignment) {
|
||||
return rw_lock.lock_count.aligned.write_lock_count;
|
||||
} else {
|
||||
if (reinterpret_cast<uintptr_t>(std::addressof(rw_lock.lock_count)) & sizeof(u32)) {
|
||||
@@ -115,8 +115,8 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
ALWAYS_INLINE const u32 &GetWriteLockCount(const ReadWriteLockType &rw_lock) {
|
||||
if constexpr (IsReadWriteLockGuaranteedAlignment) {
|
||||
ALWAYS_INLINE const u32 &GetWriteLockCount(const ReaderWriterLockType &rw_lock) {
|
||||
if constexpr (IsReaderWriterLockGuaranteedAlignment) {
|
||||
return rw_lock.lock_count.aligned.write_lock_count;
|
||||
} else {
|
||||
if (reinterpret_cast<uintptr_t>(std::addressof(rw_lock.lock_count)) & sizeof(u32)) {
|
||||
@@ -127,59 +127,59 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void IncReadLockCount(ReadWriteLockType::LockCount &lc) {
|
||||
const u32 read_lock_count = lc.counter.Get<ReadWriteLockCounter::ReadLockCount>();
|
||||
AMS_ASSERT(read_lock_count < ReadWriteLockCountMax);
|
||||
lc.counter.Set<ReadWriteLockCounter::ReadLockCount>(read_lock_count + 1);
|
||||
ALWAYS_INLINE void IncReadLockCount(ReaderWriterLockType::LockCount &lc) {
|
||||
const u32 read_lock_count = lc.counter.Get<ReaderWriterLockCounter::ReadLockCount>();
|
||||
AMS_ASSERT(read_lock_count < ReaderWriterLockCountMax);
|
||||
lc.counter.Set<ReaderWriterLockCounter::ReadLockCount>(read_lock_count + 1);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void DecReadLockCount(ReadWriteLockType::LockCount &lc) {
|
||||
const u32 read_lock_count = lc.counter.Get<ReadWriteLockCounter::ReadLockCount>();
|
||||
ALWAYS_INLINE void DecReadLockCount(ReaderWriterLockType::LockCount &lc) {
|
||||
const u32 read_lock_count = lc.counter.Get<ReaderWriterLockCounter::ReadLockCount>();
|
||||
AMS_ASSERT(read_lock_count > 0);
|
||||
lc.counter.Set<ReadWriteLockCounter::ReadLockCount>(read_lock_count - 1);
|
||||
lc.counter.Set<ReaderWriterLockCounter::ReadLockCount>(read_lock_count - 1);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void IncReadLockWaiterCount(ReadWriteLockType::LockCount &lc) {
|
||||
const u32 read_lock_waiter_count = lc.counter.Get<ReadWriteLockCounter::ReadLockWaiterCount>();
|
||||
AMS_ASSERT(read_lock_waiter_count < ReadWriteLockWaiterCountMax);
|
||||
lc.counter.Set<ReadWriteLockCounter::ReadLockWaiterCount>(read_lock_waiter_count + 1);
|
||||
ALWAYS_INLINE void IncReadLockWaiterCount(ReaderWriterLockType::LockCount &lc) {
|
||||
const u32 read_lock_waiter_count = lc.counter.Get<ReaderWriterLockCounter::ReadLockWaiterCount>();
|
||||
AMS_ASSERT(read_lock_waiter_count < ReaderWriterLockWaiterCountMax);
|
||||
lc.counter.Set<ReaderWriterLockCounter::ReadLockWaiterCount>(read_lock_waiter_count + 1);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void DecReadLockWaiterCount(ReadWriteLockType::LockCount &lc) {
|
||||
const u32 read_lock_waiter_count = lc.counter.Get<ReadWriteLockCounter::ReadLockWaiterCount>();
|
||||
ALWAYS_INLINE void DecReadLockWaiterCount(ReaderWriterLockType::LockCount &lc) {
|
||||
const u32 read_lock_waiter_count = lc.counter.Get<ReaderWriterLockCounter::ReadLockWaiterCount>();
|
||||
AMS_ASSERT(read_lock_waiter_count > 0);
|
||||
lc.counter.Set<ReadWriteLockCounter::ReadLockWaiterCount>(read_lock_waiter_count - 1);
|
||||
lc.counter.Set<ReaderWriterLockCounter::ReadLockWaiterCount>(read_lock_waiter_count - 1);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void IncWriteLockWaiterCount(ReadWriteLockType::LockCount &lc) {
|
||||
const u32 write_lock_waiter_count = lc.counter.Get<ReadWriteLockCounter::WriteLockWaiterCount>();
|
||||
AMS_ASSERT(write_lock_waiter_count < ReadWriteLockWaiterCountMax);
|
||||
lc.counter.Set<ReadWriteLockCounter::WriteLockWaiterCount>(write_lock_waiter_count + 1);
|
||||
ALWAYS_INLINE void IncWriteLockWaiterCount(ReaderWriterLockType::LockCount &lc) {
|
||||
const u32 write_lock_waiter_count = lc.counter.Get<ReaderWriterLockCounter::WriteLockWaiterCount>();
|
||||
AMS_ASSERT(write_lock_waiter_count < ReaderWriterLockWaiterCountMax);
|
||||
lc.counter.Set<ReaderWriterLockCounter::WriteLockWaiterCount>(write_lock_waiter_count + 1);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void DecWriteLockWaiterCount(ReadWriteLockType::LockCount &lc) {
|
||||
const u32 write_lock_waiter_count = lc.counter.Get<ReadWriteLockCounter::WriteLockWaiterCount>();
|
||||
ALWAYS_INLINE void DecWriteLockWaiterCount(ReaderWriterLockType::LockCount &lc) {
|
||||
const u32 write_lock_waiter_count = lc.counter.Get<ReaderWriterLockCounter::WriteLockWaiterCount>();
|
||||
AMS_ASSERT(write_lock_waiter_count > 0);
|
||||
lc.counter.Set<ReadWriteLockCounter::WriteLockWaiterCount>(write_lock_waiter_count - 1);
|
||||
lc.counter.Set<ReaderWriterLockCounter::WriteLockWaiterCount>(write_lock_waiter_count - 1);
|
||||
}
|
||||
|
||||
|
||||
ALWAYS_INLINE void IncWriteLockCount(ReadWriteLockType &rw_lock) {
|
||||
ALWAYS_INLINE void IncWriteLockCount(ReaderWriterLockType &rw_lock) {
|
||||
u32 &write_lock_count = GetWriteLockCount(rw_lock);
|
||||
AMS_ASSERT(write_lock_count < ReadWriteLockCountMax);
|
||||
AMS_ASSERT(write_lock_count < ReaderWriterLockCountMax);
|
||||
++write_lock_count;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void DecWriteLockCount(ReadWriteLockType &rw_lock) {
|
||||
ALWAYS_INLINE void DecWriteLockCount(ReaderWriterLockType &rw_lock) {
|
||||
u32 &write_lock_count = GetWriteLockCount(rw_lock);
|
||||
AMS_ASSERT(write_lock_count > 0);
|
||||
--write_lock_count;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void SetWriteLocked(ReadWriteLockType::LockCount &lc) {
|
||||
lc.counter.Set<ReadWriteLockCounter::WriteLocked>(1);
|
||||
ALWAYS_INLINE void SetWriteLocked(ReaderWriterLockType::LockCount &lc) {
|
||||
lc.counter.Set<ReaderWriterLockCounter::WriteLocked>(1);
|
||||
}
|
||||
|
||||
using ReadWriteLockImpl = ReadWriteLockTargetImpl;
|
||||
using ReaderWriterLockImpl = ReaderWriterLockTargetImpl;
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace ams::os::impl {
|
||||
(__atomic_compare_exchange(reinterpret_cast<u64 *>(&dst_ref), reinterpret_cast<u64 *>(&expected_ref), reinterpret_cast<u64 *>(&desired_ref), true, success, fail))
|
||||
|
||||
|
||||
void ReadWriteLockHorizonImpl::AcquireReadLockWriteLocked(os::ReadWriteLockType *rw_lock) {
|
||||
void ReaderWriterLockHorizonImpl::AcquireReadLockWriteLocked(os::ReaderWriterLockType *rw_lock) {
|
||||
AMS_ASSERT(GetWriteLocked(GetLockCount(rw_lock)) == 1);
|
||||
AMS_ASSERT((GetThreadHandle(GetLockCount(rw_lock)) | svc::HandleWaitMask) == (impl::GetCurrentThreadHandle() | svc::HandleWaitMask));
|
||||
alignas(alignof(u64)) LockCount expected = GetLockCount(rw_lock);
|
||||
@@ -34,7 +34,7 @@ namespace ams::os::impl {
|
||||
} while (!ATOMIC_COMPARE_EXCHANGE_LOCK_COUNT(GetLockCount(rw_lock), expected, lock_count, __ATOMIC_RELAXED, __ATOMIC_RELAXED));
|
||||
}
|
||||
|
||||
void ReadWriteLockHorizonImpl::ReleaseReadLockWriteLocked(os::ReadWriteLockType *rw_lock) {
|
||||
void ReaderWriterLockHorizonImpl::ReleaseReadLockWriteLocked(os::ReaderWriterLockType *rw_lock) {
|
||||
AMS_ASSERT(GetWriteLocked(GetLockCount(rw_lock)) == 1);
|
||||
AMS_ASSERT((GetThreadHandle(GetLockCount(rw_lock)) | svc::HandleWaitMask) == (impl::GetCurrentThreadHandle() | svc::HandleWaitMask));
|
||||
alignas(alignof(u64)) LockCount expected = GetLockCount(rw_lock);
|
||||
@@ -46,7 +46,7 @@ namespace ams::os::impl {
|
||||
return ReleaseWriteLockImpl(rw_lock);
|
||||
}
|
||||
|
||||
void ReadWriteLockHorizonImpl::ReleaseWriteLockImpl(os::ReadWriteLockType *rw_lock) {
|
||||
void ReaderWriterLockHorizonImpl::ReleaseWriteLockImpl(os::ReaderWriterLockType *rw_lock) {
|
||||
alignas(alignof(u64)) LockCount expected = GetLockCount(rw_lock);
|
||||
alignas(alignof(u64)) LockCount lock_count = expected;
|
||||
AMS_ASSERT(GetWriteLocked(lock_count) == 1);
|
||||
@@ -70,7 +70,7 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
void ReadWriteLockHorizonImpl::AcquireReadLock(os::ReadWriteLockType *rw_lock) {
|
||||
void ReaderWriterLockHorizonImpl::AcquireReadLock(os::ReaderWriterLockType *rw_lock) {
|
||||
AMS_ASSERT(::ams::svc::GetThreadLocalRegion()->disable_count == 0);
|
||||
|
||||
auto *cur_thread = impl::GetCurrentThread();
|
||||
@@ -143,7 +143,7 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
bool ReadWriteLockHorizonImpl::TryAcquireReadLock(os::ReadWriteLockType *rw_lock) {
|
||||
bool ReaderWriterLockHorizonImpl::TryAcquireReadLock(os::ReaderWriterLockType *rw_lock) {
|
||||
AMS_ASSERT(::ams::svc::GetThreadLocalRegion()->disable_count == 0);
|
||||
|
||||
auto *cur_thread = impl::GetCurrentThread();
|
||||
@@ -168,7 +168,7 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
void ReadWriteLockHorizonImpl::ReleaseReadLock(os::ReadWriteLockType *rw_lock) {
|
||||
void ReaderWriterLockHorizonImpl::ReleaseReadLock(os::ReaderWriterLockType *rw_lock) {
|
||||
AMS_ASSERT(::ams::svc::GetThreadLocalRegion()->disable_count == 0);
|
||||
|
||||
AMS_ASSERT(GetReadLockCount(GetLockCount(rw_lock)) > 0);
|
||||
@@ -226,7 +226,7 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
void ReadWriteLockHorizonImpl::AcquireWriteLock(os::ReadWriteLockType *rw_lock) {
|
||||
void ReaderWriterLockHorizonImpl::AcquireWriteLock(os::ReaderWriterLockType *rw_lock) {
|
||||
AMS_ASSERT(::ams::svc::GetThreadLocalRegion()->disable_count == 0);
|
||||
|
||||
auto *cur_thread = impl::GetCurrentThread();
|
||||
@@ -301,7 +301,7 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
bool ReadWriteLockHorizonImpl::TryAcquireWriteLock(os::ReadWriteLockType *rw_lock) {
|
||||
bool ReaderWriterLockHorizonImpl::TryAcquireWriteLock(os::ReaderWriterLockType *rw_lock) {
|
||||
AMS_ASSERT(::ams::svc::GetThreadLocalRegion()->disable_count == 0);
|
||||
|
||||
auto *cur_thread = impl::GetCurrentThread();
|
||||
@@ -334,7 +334,7 @@ namespace ams::os::impl {
|
||||
}
|
||||
}
|
||||
|
||||
void ReadWriteLockHorizonImpl::ReleaseWriteLock(os::ReadWriteLockType *rw_lock) {
|
||||
void ReaderWriterLockHorizonImpl::ReleaseWriteLock(os::ReaderWriterLockType *rw_lock) {
|
||||
AMS_ASSERT(::ams::svc::GetThreadLocalRegion()->disable_count == 0);
|
||||
|
||||
AMS_ASSERT(GetWriteLockCount(*rw_lock) > 0);
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
namespace ams::os::impl {
|
||||
|
||||
class ReadWriteLockHorizonImpl {
|
||||
class ReaderWriterLockHorizonImpl {
|
||||
private:
|
||||
using LockCount = os::ReadWriteLockType::LockCount;
|
||||
using LockCount = os::ReaderWriterLockType::LockCount;
|
||||
private:
|
||||
static ALWAYS_INLINE u32 GetThreadHandle(const LockCount &lc) {
|
||||
return GetReference(lc.cs_storage).Get()->thread_handle;
|
||||
@@ -34,19 +34,19 @@ namespace ams::os::impl {
|
||||
GetReference(lc.cs_storage).Get()->thread_handle = handle;
|
||||
}
|
||||
|
||||
static void AcquireReadLockWriteLocked(os::ReadWriteLockType *rw_lock);
|
||||
static void ReleaseReadLockWriteLocked(os::ReadWriteLockType *rw_lock);
|
||||
static void ReleaseWriteLockImpl(os::ReadWriteLockType *rw_lock);
|
||||
static void AcquireReadLockWriteLocked(os::ReaderWriterLockType *rw_lock);
|
||||
static void ReleaseReadLockWriteLocked(os::ReaderWriterLockType *rw_lock);
|
||||
static void ReleaseWriteLockImpl(os::ReaderWriterLockType *rw_lock);
|
||||
public:
|
||||
static void AcquireReadLock(os::ReadWriteLockType *rw_lock);
|
||||
static bool TryAcquireReadLock(os::ReadWriteLockType *rw_lock);
|
||||
static void ReleaseReadLock(os::ReadWriteLockType *rw_lock);
|
||||
static void AcquireReadLock(os::ReaderWriterLockType *rw_lock);
|
||||
static bool TryAcquireReadLock(os::ReaderWriterLockType *rw_lock);
|
||||
static void ReleaseReadLock(os::ReaderWriterLockType *rw_lock);
|
||||
|
||||
static void AcquireWriteLock(os::ReadWriteLockType *rw_lock);
|
||||
static bool TryAcquireWriteLock(os::ReadWriteLockType *rw_lock);
|
||||
static void ReleaseWriteLock(os::ReadWriteLockType *rw_lock);
|
||||
static void AcquireWriteLock(os::ReaderWriterLockType *rw_lock);
|
||||
static bool TryAcquireWriteLock(os::ReaderWriterLockType *rw_lock);
|
||||
static void ReleaseWriteLock(os::ReaderWriterLockType *rw_lock);
|
||||
};
|
||||
|
||||
using ReadWriteLockTargetImpl = ReadWriteLockHorizonImpl;
|
||||
using ReaderWriterLockTargetImpl = ReaderWriterLockHorizonImpl;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user