shuttle 0.6.0

A library for testing concurrent Rust code
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Shuttle's implementation of [`std::hint`].

pub use std::hint::*;

use crate::thread;

/// Emits a machine instruction to signal the processor that it is running in a busy-wait spin-loop
/// (“spin lock”).
pub fn spin_loop() {
    // Probably not necessary, but let's emit it just in case
    std::hint::spin_loop();

    thread::yield_now();
}