基质喷涂
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.

32 lines
451 B

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