| Crates.io | rustix-futex-sync |
| lib.rs | rustix-futex-sync |
| version | 0.4.0 |
| created_at | 2023-08-25 16:46:46.588455+00 |
| updated_at | 2025-04-15 16:30:05.337447+00 |
| description | Linux futex-based synchronization |
| homepage | |
| repository | https://github.com/sunfishcode/rustix-futex-sync |
| max_upload_size | |
| id | 954910 |
| size | 137,707 |
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.