Function interrupts::disable

source ·
pub fn disable() -> Guard
Expand description

Temporarily disable interrupts.

Interrupts are enabled once the returned Guard is dropped.

§Examples

// interrupts may or may not be enabled
let guard = interrupts::disable();
// interrupts are disabled
drop(guard);
// interrupts are restored to the previous state