Function compiler_interrupts::register_disable_hook[][src]

pub unsafe fn register_disable_hook(hook: fn())
Expand description

Registers a hook when disabling Compiler Interrupts.

This function takes a function pointer to be called before disabling Compiler Interrupts. Compiler Interrupts can be temporarily disabled by calling disable.

Note

This function is thread-specific, which means it only registers on the thread they called on.

This function should not be called multiple times. Consecutive calls will override the previous hook.

Safety

This function mutates a thread-local static variable which uses for the hook. Thread unsafety will not be introduced. Rust considers mutating static variable unsafe.