Skip to main content

shuttle_engine/
hint.rs

1//! Shuttle's implementation of [`std::hint`].
2
3pub use std::hint::*;
4
5use crate::thread_support;
6
7/// Emits a machine instruction to signal the processor that it is running in a busy-wait spin-loop
8/// (“spin lock”).
9pub fn spin_loop() {
10    // Probably not necessary, but let's emit it just in case
11    std::hint::spin_loop();
12
13    thread_support::yield_now();
14}