SemaphoreImpl.h 592 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #if IL2CPP_THREADS_WIN32
  3. #include "os/ErrorCodes.h"
  4. #include "os/WaitStatus.h"
  5. #include "utils/NonCopyable.h"
  6. #include "WindowsHeaders.h"
  7. namespace il2cpp
  8. {
  9. namespace os
  10. {
  11. class SemaphoreImpl : public il2cpp::utils::NonCopyable
  12. {
  13. public:
  14. SemaphoreImpl(int32_t initialValue, int32_t maximumValue);
  15. ~SemaphoreImpl();
  16. bool Post(int32_t releaseCount, int32_t* previousCount = NULL);
  17. WaitStatus Wait(bool interruptible);
  18. WaitStatus Wait(uint32_t ms, bool interruptible);
  19. private:
  20. HANDLE m_Handle;
  21. };
  22. }
  23. }
  24. #endif