Skip to main content

ax_sync/
lib.rs

1//! OS-independent synchronization interfaces for TGOSKits kernels and components.
2//!
3//! Acquisition methods state the required execution context: ordinary spin
4//! acquisitions disable preemption, `*_irqsave` acquisitions additionally
5//! save and disable local interrupts, and raw acquisitions require an explicit
6//! unsafe contract. [`Mutex`] is always sleepable and never aliases a spin
7//! lock.
8
9#![cfg_attr(
10    not(any(test, doctest, all(feature = "host-test", not(target_os = "none")))),
11    no_std
12)]
13
14#[cfg(any(test, doctest, all(feature = "host-test", not(target_os = "none"))))]
15extern crate std;
16
17mod context;
18#[cfg(all(feature = "host-test", not(target_os = "none")))]
19mod host;
20#[doc(hidden)]
21pub mod interface;
22mod lockdep;
23#[cfg(feature = "sleep")]
24mod mutex;
25mod spin;
26
27#[cfg(all(feature = "host-test", not(target_os = "none")))]
28#[doc(hidden)]
29pub use self::host::host_preempt_depth;
30#[cfg(feature = "sleep")]
31pub use self::mutex::*;
32pub use self::{context::*, lockdep::*, spin::*};