| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <nn/os/detail/os_InternalCriticalSection-os.horizon.h> |
| 4 | #include <nn/util/util_TypedStorage.h> |
| 5 | |
| 6 | namespace nn::os::detail { |
| 7 | |
| 8 | class InternalCriticalSection { |
| 9 | public: |
| 10 | void Initialize(); |
| 11 | void Finalize(); |
| 12 | void Enter(); |
| 13 | bool TryEnter(); |
| 14 | void Leave(); |
| 15 | bool IsLockedByCurrentThread() const; |
| 16 | void lock(); |
| 17 | void unlock(); |
| 18 | InternalCriticalSectionImpl* Get(); |
| 19 | |
| 20 | private: |
| 21 | InternalCriticalSectionImpl m_Impl; |
| 22 | }; |
| 23 | |
| 24 | typedef nn::util::TypedStorage<InternalCriticalSection, 4, 4> InternalCriticalSectionStorage; |
| 25 | |
| 26 | } // namespace nn::os::detail |