Cargo Features
[dependencies]
spin = { version = "0.10.0", default-features = false, features = ["mutex", "spin_mutex", "ticket_mutex", "fair_mutex", "use_ticket_mutex", "rwlock", "once", "lazy", "barrier", "lock_api", "std", "portable-atomic", "portable_atomic"] }
- default = barrier, lazy, lock_api, mutex, once, rwlock, spin_mutex
-
These default features are set whenever
spinis added withoutsomewhere in the dependency tree.default-features = false - mutex default barrier fair_mutex? spin_mutex ticket_mutex? use_ticket_mutex?
-
Enables
Mutex. Must be used with eitherspin_mutexoruse_ticket_mutex.Affects
spin::mutex,spin::Mutex,spin::lock_api.Mutex,spin::lock_api.MutexGuard… - spin_mutex default = mutex
-
Enables
SpinMutexand the default spin mutex implementation forMutex.Affects
mutex::spin… - ticket_mutex use_ticket_mutex? = mutex
-
Enables
TicketMutex.Affects
mutex::ticket… - fair_mutex = mutex
-
Enables
FairMutex.Affects
mutex::fair… - use_ticket_mutex = mutex, ticket_mutex
-
Enables the non-default ticket mutex implementation for
Mutex. - rwlock default
-
Enables
RwLock.Affects
spin::rwlock,spin::RwLock,spin::RwLockUpgradableGuard,spin::RwLockWriteGuard,spin::lock_api.RwLock,spin::lock_api.RwLockReadGuard,spin::lock_api.RwLockWriteGuard,spin::lock_api.RwLockUpgradableReadGuard… - once default lazy
-
Enables
Once.Affects
spin::once,spin::Once… - lazy default = once
-
Enables
Lazy.Affects
spin::lazy,spin::Lazy… - barrier default = mutex
-
Enables
Barrier. Because this feature usesmutex, eitherspin_mutexoruse_ticket_mutexmust be enabled.Affects
spin::barrier,spin::Barrier… - lock_api default
-
Enables
lock_api-compatible types that use the primitives in this crate internally.Enables lock_api
Affects
spin::lock_api… - std
-
Enables std-only features such as yield-relaxing.
Affects
relax::Yield… - portable-atomic portable_atomic?
-
Use the
portable-atomiccrate to support platforms without native atomic operations. Theportable_atomic_unsafe_assume_single_corecfg orcritical-sectionfeature ofportable-atomiccrate must also be set by the final binary crate. See the documentation for theportable-atomiccrate for more information with some requirements for no-std build: https://github.com/taiki-e/portable-atomic#optional-featuresEnables portable-atomic
Enable require-cas feature to provide a better error message if the end user forgets to use the cfg or feature.
- portable_atomic = portable-atomic
-
Deprecated alias: