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.

28 lines
389 B

12 months ago
11 months ago
12 months ago
11 months ago
12 months ago
  1. #pragma once
  2. #include "zbasic.h"
  3. namespace iflytop {
  4. class zmutex {
  5. public:
  6. SemaphoreHandle_t recursiveMutex;
  7. const char* name = nullptr;
  8. public:
  9. zmutex(const char* name);
  10. ~zmutex();
  11. void init();
  12. bool isInit();
  13. void lock();
  14. void unlock();
  15. };
  16. class zlock_guard {
  17. zmutex& m_mutex;
  18. public:
  19. zlock_guard(zmutex& mutex);
  20. ~zlock_guard();
  21. };
  22. } // namespace iflytop