#include <mn_lock.hpp>
Public Types | |
using | this_type = ILockObject |
Public Member Functions | |
ILockObject () | |
virtual int | lock (unsigned int timeout=0)=0 |
virtual int | time_lock (const struct timespec *timeout)=0 |
virtual int | unlock ()=0 |
virtual bool | try_lock () |
virtual bool | is_initialized () const =0 |
virtual bool | is_locked () const =0 |
Is locked? More... | |
Detailed Description
Interface for all lock types in this library This is an abstract base class. To use this, you need to subclass it. All of your LockObjetcs should be derived from the ILockObject class. Then implement the virtual lock, unlock and is_initialized functions.
Member Typedef Documentation
◆ this_type
Constructor & Destructor Documentation
◆ ILockObject()
|
inline |
Member Function Documentation
◆ is_initialized()
|
pure virtual |
Is the ILockObject created (initialized) ?
- Returns
- true if the ILockObject created (initialized) and false when not
Implemented in mn::basic_null_lock, mn::basic_semaphore, and mn::atomic_spinlock< T >.
◆ is_locked()
|
pure virtual |
◆ lock()
|
pure virtual |
lock (take) a LokObject
- Parameters
-
timeout How long to wait to get the Lock until giving up.
Implemented in mn::system::basic_critical_section_nested, mn::system::basic_critical_section_timedout, mn::basic_semaphore, mn::basic_mutex, mn::system::basic_schedular_lock, mn::system::basic_interrupts_lock, mn::system::basic_critical_section, mn::basic_null_lock, mn::basic_clock< TLockType >, and mn::atomic_spinlock< T >.
◆ time_lock()
|
pure virtual |
◆ try_lock()
|
inlinevirtual |
Try to lock the ILockObject
- Note
- call lock with timeout from 0
- Returns
- true if the Lock was acquired, false when not
Reimplemented in mn::system::basic_critical_section_timedout, and mn::atomic_spinlock< T >.
◆ unlock()
|
pure virtual |
unlock (give) a semaphore.
Implemented in mn::system::basic_schedular_lock, mn::system::basic_interrupts_lock, mn::system::basic_critical_section_nested, mn::system::basic_critical_section_timedout, mn::system::basic_critical_section, mn::basic_null_lock, mn::basic_mutex, mn::basic_clock< TLockType >, mn::basic_semaphore, and mn::atomic_spinlock< T >.
The documentation for this class was generated from the following file: