12 unstable releases (3 breaking)
| 0.4.0 | Apr 15, 2025 |
|---|---|
| 0.3.0 | Mar 6, 2025 |
| 0.2.3 | Aug 27, 2024 |
| 0.2.2 | Jun 12, 2024 |
| 0.1.3 | Aug 27, 2023 |
#602 in Unix APIs
214 downloads per month
Used in 12 crates
(5 directly)
94KB
1K
SLoC
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.
Dependencies
~1.7–6MB
~136K SLoC