You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
401 B

2 years ago
2 years ago
2 years ago
  1. #pragma once
  2. #include "osbasic_h.hpp"
  3. namespace iflytop {
  4. using namespace std;
  5. class zmutex {
  6. public:
  7. #ifdef IFLYTOP_ENABLE_OS
  8. SemaphoreHandle_t recursiveMutex;
  9. #endif
  10. public:
  11. zmutex();
  12. ~zmutex();
  13. void init();
  14. bool isInit();
  15. void lock();
  16. void unlock();
  17. };
  18. class zlock_guard {
  19. zmutex& m_mutex;
  20. public:
  21. zlock_guard(zmutex& mutex);
  22. ~zlock_guard();
  23. };
  24. } // namespace iflytop