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. | |
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 170 of file os-sched.h.
|
inline |
Lock the scheduler and remember the initial scheduler state.
Definition at line 912 of file os-sched.h.
References os::trace::printf().
|
inline |
Restore the initial scheduler state and possibly unlock the scheduler.
Definition at line 926 of file os-sched.h.
References os::rtos::scheduler::locked(), and os::trace::printf().