Expand description
Internal component of the
noxudatabase.This crate is published only so the
noxuumbrella crate can depend on it. Usenoxu(noxu = "3") in applications; depend on this crate directly only if you are extending the engine internals. Its API may change without a major version bump.
Noxu DB synchronization primitives.
Futex-based Mutex<T>, RwLock<T>, and Condvar that replace
parking_lot throughout the Noxu codebase.
§Extra capabilities vs parking_lot
| Method | Description |
|---|---|
Mutex::get_n_waiters() | Count of threads blocked waiting for the mutex |
Mutex::get_owner() | Thread ID hash of the current owner |
RwLock::get_n_waiters() | Count of threads blocked waiting for the rwlock |
RwLock::is_locked_exclusive() | Returns true when a write lock is held |
RwLock::reader_count() | Number of active shared-lock holders (global) |
§Drop-in compatibility
The public types are designed to be drop-in replacements for the
corresponding parking_lot types:
parking_lot::Mutex<T> → noxu_sync::Mutex<T>
parking_lot::RwLock<T> → noxu_sync::RwLock<T>
parking_lot::Condvar → noxu_sync::Condvar
parking_lot::RawMutex → noxu_sync::RawMutex
parking_lot::lock_api::… → noxu_sync::lock_api::…
parking_lot::MutexGuard<'_,T> → noxu_sync::MutexGuard<'_,T>
parking_lot::WaitTimeoutResult → noxu_sync::WaitTimeoutResultRe-exports§
pub use condvar::Condvar;pub use condvar::WaitTimeoutResult;pub use raw_mutex::NoxuRawMutex;pub use raw_rwlock::NoxuRawRwLock;pub use lock_api;
Modules§
- condvar
- Futex-based condition variable.
- futex
- Platform-level futex abstraction.
- raw_
mutex - Futex-based raw mutex implementing
lock_api::RawMutex. - raw_
rwlock - Futex-based raw reader-writer lock implementing
lock_api::RawRwLock.
Structs§
- RwLock
- Reader-writer lock backed by a futex.
Type Aliases§
- Mutex
- Mutual exclusion primitive backed by a futex.
- Mutex
Guard - RAII guard returned by
Mutex::lock. - RawMutex
- The raw mutex type for direct embed (e.g.,
log_buffer.rs). - RwLock
Read Guard - RAII guard returned by
RwLock::read. - RwLock
Write Guard - RAII guard returned by
RwLock::write.