|
ELEC-C7222
Libraries for ELEC C7222 Course Work
|
Critical-section wrapper with destructor-based exit cleanup. More...
#include <freertos_critical_section.hpp>


Public Member Functions | |
| FreeRtosCriticalSection ()=default | |
| Construct a critical-section wrapper in the unlocked state. | |
| ~FreeRtosCriticalSection () | |
| Ensure the critical section is exited on destruction if entered. | |
| void | Enter () |
| Enter the critical section (no-op if already entered by this object). | |
| bool | Exit () |
| Exit the critical section. | |
| bool | IsEntered () const |
Public Member Functions inherited from c7222::NonCopyable | |
| NonCopyable (const NonCopyable &)=delete | |
| NonCopyable & | operator= (const NonCopyable &)=delete |
| NonCopyable (NonCopyable &&)=default | |
| NonCopyable & | operator= (NonCopyable &&)=default |
Public Member Functions inherited from c7222::NonMovable | |
| NonMovable (const NonMovable &)=default | |
| NonMovable & | operator= (const NonMovable &)=default |
| NonMovable (NonMovable &&)=delete | |
| NonMovable & | operator= (NonMovable &&)=delete |
Additional Inherited Members | |
Protected Member Functions inherited from c7222::NonCopyableNonMovable | |
| NonCopyableNonMovable ()=default | |
| ~NonCopyableNonMovable ()=default | |
Protected Member Functions inherited from c7222::NonCopyable | |
| NonCopyable ()=default | |
| ~NonCopyable ()=default | |
Protected Member Functions inherited from c7222::NonMovable | |
| NonMovable ()=default | |
| ~NonMovable ()=default | |
Critical-section wrapper with destructor-based exit cleanup.
This wrapper protects short non-blocking regions that must not be interrupted by context switches/interrupt handlers (platform dependent).
The object tracks a binary entered state (depth_ is 0 or 1). Calling Enter() while already entered is a no-op for this object, and destruction exits the critical section if it is still entered.
Typical usage:
|
default |
Construct a critical-section wrapper in the unlocked state.
| c7222::FreeRtosCriticalSection::~FreeRtosCriticalSection | ( | ) |
Ensure the critical section is exited on destruction if entered.
| void c7222::FreeRtosCriticalSection::Enter | ( | ) |
Enter the critical section (no-op if already entered by this object).
| bool c7222::FreeRtosCriticalSection::Exit | ( | ) |
Exit the critical section.
| bool c7222::FreeRtosCriticalSection::IsEntered | ( | ) | const |