core::hint::spin_loop - Rust
Description: API documentation for the Rust `spin_loop` fn in crate `core`.
Keywords: rust, rustlang, rust-lang, spin_loop

# [−][src]Function core::hint::spin_loop

    pub fn spin_loop()

🔬 This is a nightly-only experimental API. (`renamed_spin_loop` #55002)

Emits a machine instruction hinting to the processor that it is running in busy-wait spin-loop ("spin lock").

For a discussion of different locking strategies and their trade-offs, see `core::sync::atomic::spin_loop_hint`.

Note: On platforms that do not support receiving spin-loop hints this function does not do anything at all.