mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-25 04:04:22 -04:00
os: implement SdkRecursiveMutex
This commit is contained in:
parent
c949779b3d
commit
b25218c918
7 changed files with 226 additions and 22 deletions
|
@ -42,15 +42,15 @@ namespace ams::os {
|
|||
private:
|
||||
friend class SdkConditionVariable;
|
||||
private:
|
||||
SdkMutexType mutex;
|
||||
SdkMutexType m_mutex;
|
||||
public:
|
||||
constexpr SdkMutex() : mutex{{0}} { /* ... */ }
|
||||
constexpr SdkMutex() : m_mutex{{0}} { /* ... */ }
|
||||
|
||||
ALWAYS_INLINE void Lock() { return os::LockSdkMutex(std::addressof(this->mutex)); }
|
||||
ALWAYS_INLINE bool TryLock() { return os::TryLockSdkMutex(std::addressof(this->mutex)); }
|
||||
ALWAYS_INLINE void Unlock() { return os::UnlockSdkMutex(std::addressof(this->mutex)); }
|
||||
ALWAYS_INLINE void Lock() { return os::LockSdkMutex(std::addressof(m_mutex)); }
|
||||
ALWAYS_INLINE bool TryLock() { return os::TryLockSdkMutex(std::addressof(m_mutex)); }
|
||||
ALWAYS_INLINE void Unlock() { return os::UnlockSdkMutex(std::addressof(m_mutex)); }
|
||||
|
||||
ALWAYS_INLINE bool IsLockedByCurrentThread() const { return os::IsSdkMutexLockedByCurrentThread(std::addressof(this->mutex)); }
|
||||
ALWAYS_INLINE bool IsLockedByCurrentThread() const { return os::IsSdkMutexLockedByCurrentThread(std::addressof(m_mutex)); }
|
||||
|
||||
ALWAYS_INLINE void lock() { return this->Lock(); }
|
||||
ALWAYS_INLINE bool try_lock() { return this->TryLock(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue