mn_recursive_mutex.hpp
Go to the documentation of this file.
1 
19 #ifndef MINLIB_ESP32_REC_MUTEX_
20 #define MINLIB_ESP32_REC_MUTEX_
21 
22 #include "mn_config.hpp"
23 #include "mn_mutex.hpp"
24 
25 namespace mn {
26 #if MN_THREAD_CONFIG_RECURSIVE_MUTEX == MN_THREAD_CONFIG_YES
43 class recursive_mutex : public basic_mutex {
44 public:
54  recursive_mutex();
55 
56  recursive_mutex(const recursive_mutex& o) : basic_mutex(o) { }
66  virtual int lock(unsigned int timeout = MN_THREAD_CONFIG_TIMEOUT_MUTEX_DEFAULT);
67 
76  virtual int unlock();
77 };
78 
79 using remutex_t = recursive_mutex;
80 
81 #endif // MN_THREAD_CONFIG_RECURSIVE_MUTEX MN_THREAD_CONFIG_YES
82 
83 }
84 
85 #endif // MINLIB_ESP32_REC_MUTEX_
#define MN_THREAD_CONFIG_TIMEOUT_MUTEX_DEFAULT
Definition: mn_config.hpp:368
Definition: mn_allocator_typetraits.hpp:25
int lock(TLOCK &m1, unsigned int timeout)
Definition: mn_autolock.hpp:70
int unlock(TLOCK &m1)
Definition: mn_autolock.hpp:73