OS  v1.7.5
Documentation
Loading...
Searching...
No Matches
qOS::critical::lock Class Referencefinal

Scoped critical section lock. More...

#include <critical.hpp>

Inheritance diagram for qOS::critical::lock:
[legend]
Collaboration diagram for qOS::critical::lock:
[legend]

Public Member Functions

 lock () noexcept
 
 ~lock () noexcept
 
 operator bool () noexcept
 

Detailed Description

Scoped critical section lock.

The `lock` class provides a simple RAII-based mechanism for managing critical sections. When an object of this class is created, it automatically enters a critical section (disabling interrupts). When the object is destroyed, it exits the critical section (restoring interrupts).

void example() {
// Code that runs in a critical section
}
Scoped critical section lock.
Definition critical.hpp:92

Constructor & Destructor Documentation

◆ lock()

qOS::critical::lock::lock ( )
noexcept

◆ ~lock()

qOS::critical::lock::~lock ( )
noexcept

Member Function Documentation

◆ operator bool()

qOS::critical::lock::operator bool ( )
explicitnoexcept