Scheduler critical section RAII helper. More...
#include <cmsis-plus/rtos/os.h>
Public Member Functions | |
Constructors & Destructor | |
critical_section () | |
Enter a critical section. | |
~critical_section () | |
Exit a critical section. | |
Scheduler critical section RAII helper.
Use this class to define a critical section protected to scheduler switches. The beginning of the critical section is exactly the place where this class is instantiated (the constructor will lock the scheduler). The end of the critical section is the end of the surrounding block (the destructor will unlock the scheduler).
Definition at line 181 of file os-sched.h.
|
inline |
Enter a critical section.
Lock the scheduler and remember the initial scheduler state.
Definition at line 937 of file os-sched.h.
|
inline |
Exit a critical section.
Restore the initial scheduler state and possibly unlock the scheduler.
Definition at line 953 of file os-sched.h.