Skip to main content

std/sys/sync/futex/
mod.rs

1cfg_select! {
2    any(
3        target_os = "linux",
4        target_os = "android",
5        all(target_os = "emscripten", target_feature = "atomics"),
6        target_os = "freebsd",
7        target_os = "openbsd",
8        target_os = "dragonfly",
9        target_os = "fuchsia",
10    ) => {
11        mod unix;
12        pub use unix::*;
13    }
14    all(target_os = "windows", not(target_vendor = "win7")) => {
15        mod windows;
16        pub use windows::*;
17    }
18    target_os = "hermit" => {
19        mod hermit;
20        pub use hermit::*;
21    }
22    // The wasi-libc based futex is new enough that it's not present in older
23    // wasi-libc builds. For now that means it's only required on wasip3 (which
24    // requires a newer wasi-libc anyway). In the future this'll probably switch to
25    // unconditionally using `wasilibc` as the implementation for all WASI
26    // targets (and switching all synchronization primitives to the futex version).
27    all(target_os = "wasi", target_env = "p3") => {
28        mod wasilibc;
29        pub use wasilibc::*;
30    }
31    all(target_family = "wasm", target_feature = "atomics") => {
32        mod wasm;
33        pub use wasm::*;
34    }
35    target_os = "motor" => {
36        pub use moto_rt::futex::*;
37    }
38    _ => {}
39}