Skip to main content

in_atomic_context

Function in_atomic_context 

Source
pub fn in_atomic_context() -> bool
Expand description

Returns whether the current context is atomic, meaning sleeping or rescheduling is not allowed.

This matches the intent of Linux’s might_sleep(): catch misuse from IRQ-disabled or preempt-disabled regions before a sleep-like action happens.