ConditionVariableImpl.h 553 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #if NET_4_0
  3. #if IL2CPP_THREADS_PTHREAD
  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
  26. #endif