Handle.h 710 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <stdint.h>
  3. #include <vector>
  4. #include "utils/NonCopyable.h"
  5. #include "os/WaitStatus.h"
  6. namespace il2cpp
  7. {
  8. namespace os
  9. {
  10. class Handle : public il2cpp::utils::NonCopyable
  11. {
  12. public:
  13. virtual ~Handle() {}
  14. virtual bool Wait() = 0;
  15. virtual bool Wait(uint32_t ms) = 0;
  16. virtual WaitStatus Wait(bool interruptible) = 0;
  17. virtual WaitStatus Wait(uint32_t ms, bool interruptible) = 0;
  18. virtual void Signal() = 0;
  19. static int32_t WaitAny(const std::vector<Handle*>& handles, int32_t ms);
  20. static bool WaitAll(std::vector<Handle*>& handles, int32_t ms);
  21. private:
  22. static const int m_waitIntervalMs = 10;
  23. };
  24. }
  25. }