libxr 1.0
Want to be the best embedded framework
|
回调(ISR)上下文中的互斥锁管理类 (Lock management class for ISR context). More...
#include <mutex.hpp>
Public Member Functions | |
LockGuardInCallback (Mutex &mutex, bool in_isr) | |
构造函数,尝试在 ISR 上下文中加锁 (Constructor attempting to lock the mutex inside ISR context). | |
~LockGuardInCallback () | |
析构函数,自动释放锁(如果成功加锁) (Destructor automatically unlocking the mutex if successfully locked). | |
bool | Locked () |
检查是否成功加锁 (Check if the mutex was successfully locked). | |
Private Attributes | |
Mutex & | mutex_ |
被管理的互斥锁 (Reference to the managed mutex). | |
ErrorCode | success_ |
记录加锁的状态 (Stores the lock acquisition status). | |
bool | in_isr_ |
记录是否处于 ISR 上下文 (Indicates if in ISR context). | |
回调(ISR)上下文中的互斥锁管理类 (Lock management class for ISR context).
This class attempts to acquire the lock inside an ISR and releases it when the object goes out of scope. 该类尝试在 ISR 中获取锁,并在对象销毁时释放锁。
构造函数,尝试在 ISR 上下文中加锁 (Constructor attempting to lock the mutex inside ISR context).
mutex | 需要管理的互斥锁 (Reference to the mutex to manage). |
in_isr | 指示当前是否处于 ISR 上下文 (Indicates if the function is in ISR context). |
Definition at line 132 of file mutex.hpp.
|
inline |
析构函数,自动释放锁(如果成功加锁) (Destructor automatically unlocking the mutex if successfully locked).
Definition at line 141 of file mutex.hpp.
|
inline |
|
private |
|
private |
|
private |