mn_null_lock.hpp
Go to the documentation of this file.
1 
19 #ifndef MINLIB_ESP32_NULL_LOCK_
20 #define MINLIB_ESP32_NULL_LOCK_
21 
22 #include "mn_config.hpp"
23 
24 #include "mn_error.hpp"
25 #include "mn_lock.hpp"
26 
27 
28 namespace mn {
33  class basic_null_lock : public ILockObject {
34  public:
40  virtual int lock(unsigned int timeout = 0) { return NO_ERROR; }
44  virtual int unlock() { return NO_ERROR; }
50  virtual bool is_initialized() const { return true; }
51 
52  virtual int time_lock(const struct timespec *timeout) { return NO_ERROR; }
53  };
54 
56 }
57 
58 #endif // MINLIB_ESP32_NULL_LOCK_
Definition: mn_lock.hpp:64
Null Lock is a lock object without any lock logic.
Definition: mn_null_lock.hpp:33
virtual int unlock()
Definition: mn_null_lock.hpp:44
virtual int lock(unsigned int timeout=0)
Definition: mn_null_lock.hpp:40
virtual int time_lock(const struct timespec *timeout)
Definition: mn_null_lock.hpp:52
virtual bool is_initialized() const
Definition: mn_null_lock.hpp:50
basic_null_lock()
Definition: mn_null_lock.hpp:35
A list of all error codes in this lib. This file is part of the Mini Thread Library (https://github....
#define NO_ERROR
Definition: mn_error.hpp:53
Definition: mn_allocator_typetraits.hpp:25