ConditionVariableImpl.h 571 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #if IL2CPP_THREADS_PTHREAD && !RUNTIME_TINY
  3. #include <stdint.h>
  4. #include <pthread.h>
  5. #include "utils/NonCopyable.h"
  6. class FastMutexImpl;
  7. namespace il2cpp
  8. {
  9. namespace os
  10. {
  11. class ConditionVariableImpl : public il2cpp::utils::NonCopyable
  12. {
  13. public:
  14. ConditionVariableImpl();
  15. ~ConditionVariableImpl();
  16. int Wait(FastMutexImpl* lock);
  17. int TimedWait(FastMutexImpl* lock, uint32_t timeout_ms);
  18. void Broadcast();
  19. void Signal();
  20. private:
  21. pthread_cond_t m_ConditionVariable;
  22. };
  23. }
  24. }
  25. #endif