Skip to content

hal::critical_section

Critical section trait.

A token-based critical section masks interrupts up to a configurable priority threshold. Not all interrupts are masked — real-time properties are preserved for high-priority events. The token restores the previous interrupt state when dropped.

trait CriticalSection {
fn enter() -> Self::Token
}

A critical section implementation.

trait CriticalSectionToken {
fn release(self)
}

Opaque token whose drop restores the previous interrupt state.