Mark3 Realtime Kernel
Mark3::CriticalSection Class Reference

The CriticalSection class. This class implements a portable CriticalSection interface based on macros/inline functions that are implemented as part of each port. More...

#include <criticalsection.h>

Static Public Member Functions

static void Enter ()
 Enter Enter a critical section, disabling all kernel-aware interrupts, and giving exclusive control of the CPU to the curreninttly running task. More...
 
static void Exit ()
 Exit Exit a critical section, re-enabling kernel-aware interrupts, and releasing exclusive control of the CPU. More...
 
static K_WORD NestingCount ()
 NestingCount. More...
 

Detailed Description

The CriticalSection class. This class implements a portable CriticalSection interface based on macros/inline functions that are implemented as part of each port.

Critical sections can be safely nested, that is, multiple calls to Enter() may be called before matching calls to Exit() are called. In such cases, only the final call to Exit() will cause the caller to relinquish control of the CPU.

Critical sections can be safely used within interrupts; although they have no effect in the general case. The exception is in the case where a system has multiple levels of interrupt nesting; at which point calling a critical section from an interrupt temporarily disables subsequent levels of nesting.

Care, however, must be taken to ensure that the currently executing thread does not block when a critical section is active. This condition is guaranteed to break the system.

Definition at line 48 of file criticalsection.h.

Member Function Documentation

◆ Enter()

static void Mark3::CriticalSection::Enter ( )
inlinestatic

Enter Enter a critical section, disabling all kernel-aware interrupts, and giving exclusive control of the CPU to the curreninttly running task.

Definition at line 56 of file criticalsection.h.

◆ Exit()

static void Mark3::CriticalSection::Exit ( )
inlinestatic

Exit Exit a critical section, re-enabling kernel-aware interrupts, and releasing exclusive control of the CPU.

Definition at line 65 of file criticalsection.h.

◆ NestingCount()

static K_WORD Mark3::CriticalSection::NestingCount ( )
inlinestatic

NestingCount.

Returns
Number of Enter() calls awaiting an Exit() call.

Definition at line 73 of file criticalsection.h.


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