Available on crate feature
mutex
only.Expand description
Locks that have the same behaviour as a mutex.
The Mutex
in the root of the crate, can be configured using the ticket_mutex
feature.
If it’s enabled, TicketMutex
and TicketMutexGuard
will be re-exported as Mutex
and MutexGuard
, otherwise the SpinMutex
and guard will be re-exported.
ticket_mutex
is disabled by default.
Re-exports
pub use self::spin::SpinMutex;
pub use self::spin::SpinMutexGuard;
pub use self::ticket::TicketMutex;
pub use self::ticket::TicketMutexGuard;
pub use self::fair::FairMutex;
pub use self::fair::FairMutexGuard;
pub use self::fair::Starvation;
Modules
- fair
fair_mutex
A spinning mutex with a fairer unlock algorithm. - spin
spin_mutex
A naïve spinning mutex. - ticket
ticket_mutex
A ticket-based mutex.
Structs
- A spin-based lock providing mutually exclusive access to data.
- A generic guard that will protect some data access and uses either a ticket lock or a normal spin mutex.