barging and lock_api only.Expand description
Unfair MCS lock aliases for lock_api::Mutex.
This module exports lock_api::Mutex and lock_api::MutexGuard type
aliases with a barging MCS lock and guard as their inner types. The
barging::Mutex type will implement the lock_api::RawMutex trait when
this feature is enabled. The barging MCS lock is a unfair lock.
This module provides an implementation that is no_std compatible.
The lock is hold for as long as its associated RAII guard is in scope. Once
the guard is dropped, the mutex is freed. Mutex guards are returned by
lock and try_lock.
This Mutex is generic over the two layers of relax policies. User may
choose a policy as long as it implements the Relax trait. The shared
lock relax policy is associated with the Rs generic paramater. The
handoff relax policy is then associated with the Rq generic parameter.
Backoff relax policies are usually prefered for shared lock contention,
while non-backoff relax policies are usually prefered for handoffs.
There is a number of relax policies provided by the relax module. The
following modules provide type aliases for lock_api::Mutex and
lock_api::MutexGuard associated with a relax policy. See their
documentation for more information.
Modules§
- loops
- An unfair MCS lock that implements a
looprelax policy. - spins
- An unfair MCS lock that implements a
spinrelax policy. - yields
yield - An unfair MCS lock that implements a
yieldrelax policy.
Type Aliases§
- Mutex
- A
lock_api::Mutexalias that wraps abarging::Mutex. - Mutex
Guard - A
lock_api::MutexGuardalias that wraps abarging::MutexGuard.