Expand description
§Flexible Locks
This crate aims at providing generic, flexible implementations of locking
primitives. For now, it only provides Mutex
types (i.e. no RwLock
, etc.),
without poisoning, and without try_lock
. Support for those can be
added in the future if there is interest (patches welcome). Poisoning is not
necessary with panic=abort.
The provided types allow flexibility in layout and locking implementation.
See the Mutex
, MutexWrap
and RawOsMutex
documentation for more
details.
§Features
The parking_lot
feature can be enabled, providing a RawMutex
implementation for parking_log::Mutex<()>
.
Macros§
- mutex_
new - Statically initializes a
Mutex
or aMutexWrap
. - pthread_
mutex_ new - Statically initializes a
pthread_mutex_t
- raw_
os_ mutex_ new - Statically initializes a
RawOsMutex
Structs§
- Mutex
- A mutual exclusion primitive useful for protecting shared data
- Mutex
Guard - An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
- Mutex
Wrap - A mutual exclusion primitive useful for protecting shared data
- RawOs
Mutex - Platform mutex primitives for use with [
Mutex
] and [MutexWrap
].
Traits§
- Mutex
Protected - A trait describing types that can be wrapped in a
Mutex
. - RawMutex
- A trait for raw mutual exclusion primitives.
- Unsafe
RawOs Mutex - A trait for unsafe raw mutual exclusion primitives.
Type Aliases§
- pthread_
mutex_ t RawOsMutex
wrapper forlibc::pthread_mutex_t
.