Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FastReaderReaderWriterLockImpl.h 788B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. #include "il2cpp-config.h"
  3. #if IL2CPP_USE_BASELIB_FAST_READER_RWL
  4. #include "Baselib.h"
  5. #include "Cpp/Lock.h"
  6. namespace il2cpp
  7. {
  8. namespace os
  9. {
  10. // This FastReaderReaderWriterLockImpl uses the baselib non-recursive lock
  11. // There is no reader writer lock in baselib and this the fastest baselib lock (on some platforms....)
  12. class FastReaderReaderWriterLockImpl
  13. {
  14. public:
  15. void LockExclusive()
  16. {
  17. m_Lock.Acquire();
  18. }
  19. void LockShared()
  20. {
  21. m_Lock.Acquire();
  22. }
  23. void ReleaseExclusive()
  24. {
  25. m_Lock.Release();
  26. }
  27. void ReleaseShared()
  28. {
  29. m_Lock.Release();
  30. }
  31. private:
  32. baselib::Lock m_Lock;
  33. };
  34. }
  35. }
  36. #endif