Function compiler_interrupts::disable [−][src]
pub unsafe fn disable()
Expand description
Disables Compiler Interrupts.
This function disables Compiler Interrupts if it is currently enabled.
Note
This function is thread-specific, which means it only disables on the thread they called on.
This function can be called multiple times. Consecutive calls will do nothing as the interrupts are already disabled.
Safety
This function mutates a thread-local static variable which uses for the counter. Thread unsafety will not be introduced. Rust considers mutating static variable unsafe.
Examples
unsafe { // disables the interrupts compiler_interrupts::disable(); } for _ in 0..42 { println!("interrupts have been disabled"); } unsafe { // re-enables the interrupts compiler_interrupts::enable(); }