SuperTinyKernel™ RTOS 1.06.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
stk::hw::CriticalSection::ScopedLock Class Reference

RAII guard that enters the critical section on construction and exits it on destruction. More...

#include <stk_arch.h>

Public Member Functions

 ScopedLock ()
 Enter the critical section.
 ~ScopedLock ()
 Exit the critical section.

Private Member Functions

 STK_NONCOPYABLE_CLASS (ScopedLock)

Detailed Description

RAII guard that enters the critical section on construction and exits it on destruction.

Note
Guarantees Exit() is always called even if an early return or exception unwinds the scope.

Usage example:

{
// shared resource access protected here
} // CriticalSection::Exit() called automatically
RAII guard that enters the critical section on construction and exits it on destruction.
Definition stk_arch.h:240

Definition at line 239 of file stk_arch.h.

Constructor & Destructor Documentation

◆ ScopedLock()

stk::hw::CriticalSection::ScopedLock::ScopedLock ( )
inlineexplicit

Enter the critical section.

Definition at line 244 of file stk_arch.h.

static void Enter()
Enter a critical section.

References stk::hw::CriticalSection::Enter().

Referenced by STK_NONCOPYABLE_CLASS().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~ScopedLock()

stk::hw::CriticalSection::ScopedLock::~ScopedLock ( )
inline

Exit the critical section.

Definition at line 248 of file stk_arch.h.

static void Exit()
Exit a critical section.

References stk::hw::CriticalSection::Exit().

Here is the call graph for this function:

Member Function Documentation

◆ STK_NONCOPYABLE_CLASS()

stk::hw::CriticalSection::ScopedLock::STK_NONCOPYABLE_CLASS ( ScopedLock )
private

References ScopedLock().

Here is the call graph for this function:

The documentation for this class was generated from the following file: