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.
These types use the FUTEX_PRIVATE_FLAG flag so they don’t work for
synchronizing in memory shared between multiple processes. Enabling the “shm”
feature enables the shm module, which contains shared-memory versions of all
the main types.
Re-exports§
pub use lock_api;lock_api
Modules§
Structs§
- Once
State - State yielded to
Once::call_once_force()’s closure parameter. The state can be used to query the poison status of theOnce. - Wait
Timeout Result lock_api - A type indicating whether a timed wait on a condition variable returned due to a time out or not.
Type Aliases§
- Condvar
lock_api - Mapped
Mutex Guard lock_api - Mapped
RwLock Read Guard lock_api - Mapped
RwLock Write Guard lock_api - Mutex
lock_api - Mutex
Guard lock_api - Once
- Once
Lock - RawCondvar
- RawMutex
- RawRw
Lock - Reentrant
Mutex atomic_usize - Reentrant
Mutex Guard atomic_usize - RwLock
lock_api - RwLock
Read Guard lock_api - RwLock
Write Guard lock_api