123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #pragma once
- #if IL2CPP_THREADS_WIN32
- #include "WindowsHeaders.h"
- namespace il2cpp
- {
- namespace os
- {
- class ReaderWriterLockImpl
- {
- public:
- ReaderWriterLockImpl()
- {
- InitializeSRWLock(&m_Lock);
- }
- void LockExclusive()
- {
- AcquireSRWLockExclusive(&m_Lock);
- }
- void LockShared()
- {
- AcquireSRWLockShared(&m_Lock);
- }
- void ReleaseExclusive()
- {
- ReleaseSRWLockExclusive(&m_Lock);
- }
- void ReleaseShared()
- {
- ReleaseSRWLockShared(&m_Lock);
- }
- PSRWLOCK GetOSHandle()
- {
- return &m_Lock;
- }
- private:
- SRWLOCK m_Lock;
- };
- }
- }
- #endif
|