Monitor.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #include "il2cpp-config.h"
  3. struct Il2CppObject;
  4. namespace il2cpp
  5. {
  6. namespace vm
  7. {
  8. class LIBIL2CPP_CODEGEN_API Monitor
  9. {
  10. public:
  11. static void Enter(Il2CppObject* object);
  12. static bool TryEnter(Il2CppObject* object, uint32_t timeout);
  13. static void Exit(Il2CppObject* object);
  14. static void Pulse(Il2CppObject* object);
  15. static void PulseAll(Il2CppObject* object);
  16. static void Wait(Il2CppObject* object);
  17. static bool TryWait(Il2CppObject* object, uint32_t timeout);
  18. static bool IsAcquired(Il2CppObject* object);
  19. };
  20. #if !IL2CPP_SUPPORT_THREADS
  21. inline void Monitor::Enter(Il2CppObject* object)
  22. {
  23. }
  24. inline bool Monitor::TryEnter(Il2CppObject* object, uint32_t timeout)
  25. {
  26. return true;
  27. }
  28. inline void Monitor::Exit(Il2CppObject* object)
  29. {
  30. }
  31. inline void Monitor::Pulse(Il2CppObject* object)
  32. {
  33. }
  34. inline void Monitor::PulseAll(Il2CppObject* object)
  35. {
  36. }
  37. inline void Monitor::Wait(Il2CppObject* object)
  38. {
  39. }
  40. inline bool Monitor::TryWait(Il2CppObject* object, uint32_t timeout)
  41. {
  42. return true;
  43. }
  44. inline bool Monitor::IsAcquired(Il2CppObject* object)
  45. {
  46. return true;
  47. }
  48. #endif
  49. } /* namespace vm */
  50. } /* namespace il2cpp */