![]() |
SuperTinyKernel™ RTOS 1.05.3
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Nestable, SMP-safe critical section that combines local interrupt masking with a global cross-core spinlock. More...
#include <stk_arch.h>
Classes | |
| class | ScopedLock |
| RAII guard that enters the critical section on construction and exits it on destruction. More... | |
Static Public Member Functions | |
| static void | Enter () |
| Enter a critical section. | |
| static void | Exit () |
| Exit a critical section. | |
Private Member Functions | |
| CriticalSection () | |
| STK_NONCOPYABLE_CLASS (CriticalSection) | |
Nestable, SMP-safe critical section that combines local interrupt masking with a global cross-core spinlock.
g_CsuLock) is then acquired to block any other core from entering the same critical section concurrently. On Enter() the spinlock is only acquired at nesting depth 0 so that nested Enter() calls from the same core do not deadlock. On Exit(), the spinlock is released and interrupts are restored only when the outermost Exit() brings the nesting counter back to zero. Definition at line 201 of file stk_arch.h.
|
inlineexplicitprivate |
Definition at line 253 of file stk_arch.h.
Referenced by STK_NONCOPYABLE_CLASS().
|
static |
Enter a critical section.
Definition at line 74 of file stktest.cpp.
References stk::test::g_CriticalSectionState.
Referenced by stk::sync::ScopedCriticalSection::Lock(), stk::hw::CriticalSection::ScopedLock::ScopedLock(), and stk_critical_section_enter().
|
static |
Exit a critical section.
Definition at line 78 of file stktest.cpp.
References stk::test::g_CriticalSectionState.
Referenced by stk_critical_section_exit(), stk::sync::ScopedCriticalSection::Unlock(), and stk::hw::CriticalSection::ScopedLock::~ScopedLock().
|
private |