SemaphoreImpl.h 621 B

123456789101112131415161718192021222324252627282930
  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. void* GetOSHandle();
  20. private:
  21. HANDLE m_Handle;
  22. };
  23. }
  24. }
  25. #endif