Expand description
Linux futex-based implementations of Mutex, RwLock, Condvar,
Once, and OnceLock, as well as RawMutex, RawRwLock, and
RawCondvar, derived from the futex code in std, factored out to a
standalone no_std crate using rustix to do the futex and lock_api to
provide most of the public Mutex and RwLock API.
lock_api does not support poisoning, so support for poisoning is omitted.
In this library, Condvar, RawCondvar, RawMutex, and Once are guaranteed
to be repr(transparent) wrappers around a single AtomicU32. RawRwLock is
guaranteed to be a repr(C) wrapper around two AtomicU32s. The contents of
these AtomicU32s are not documented, except that all these types’
const fn new() and INIT are guaranteed to initialize them to all zeros.
Re-exports§
pub use lock_api;
Structs§
- Condvar
- A Condition Variable
- Once
- A synchronization primitive which can be used to run a one-time global
initialization. Useful for one-time initialization for FFI or related
functionality. This type can only be constructed with
Once::new(). - Once
Lock - A synchronization primitive which can nominally be written to only once.
- Once
State - State yielded to
Once::call_once_force()’s closure parameter. The state can be used to query the poison status of theOnce. - RawCondvar
- RawMutex
- An implementation of
lock_api::RawMutex. - RawRw
Lock - An implementation of
lock_api::RawRwLock. - Wait
Timeout Result - A type indicating whether a timed wait on a condition variable returned due to a time out or not.