ELEC-C7222
Libraries for ELEC C7222 Course Work
Loading...
Searching...
No Matches
freertos_critical_section.hpp
Go to the documentation of this file.
1
5#ifndef ELEC_C7222_UTILS_FREERTOS_CRITICAL_SECTION_HPP
6#define ELEC_C7222_UTILS_FREERTOS_CRITICAL_SECTION_HPP
7
8#include <cstdint>
9
10#include "non_copyable.hpp"
11
12namespace c7222 {
13
35 public:
40
42 void Enter();
47 bool Exit();
49 bool IsEntered() const;
50
51 private:
52 std::uint32_t depth_{0};
53};
54
55} // namespace c7222
56
57#endif // ELEC_C7222_UTILS_FREERTOS_CRITICAL_SECTION_HPP
Critical-section wrapper with destructor-based exit cleanup.
Definition freertos_critical_section.hpp:34
FreeRtosCriticalSection()=default
Construct a critical-section wrapper in the unlocked state.
~FreeRtosCriticalSection()
Ensure the critical section is exited on destruction if entered.
bool Exit()
Exit the critical section.
void Enter()
Enter the critical section (no-op if already entered by this object).
Disable both copy and move operations.
Definition non_copyable.hpp:75
C7222 course abstractions namespace.
Definition ble.hpp:20
Base classes to control copy/move semantics.