Cargo Features
[dependencies]
spin = { version = "0.9.8", default-features = false, features = ["mutex", "spin_mutex", "ticket_mutex", "fair_mutex", "use_ticket_mutex", "rwlock", "once", "lazy", "barrier", "lock_api", "std", "portable_atomic"] }
- default = barrier, lazy, lock_api, mutex, once, rwlock, spin_mutex
-
These default features are set whenever
spin
is added without
somewhere 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_mutex
oruse_ticket_mutex
.Affects
spin::mutex
,spin::Mutex
,spin::lock_api.Mutex
,spin::lock_api.MutexGuard
… - spin_mutex default = mutex
-
Enables
SpinMutex
and 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_mutex
oruse_ticket_mutex
must be enabled.Affects
spin::barrier
,spin::Barrier
… - lock_api default = lock_api_crate
-
Enables
lock_api
-compatible types that use the primitives in this crate internally.Affects
spin::lock_api
… - std
-
Enables std-only features such as yield-relaxing.
Affects
relax::Yield
… - portable_atomic = portable-atomic
-
Use the portable_atomic crate to support platforms without native atomic operations. The
portable_atomic_unsafe_assume_single_core
cfg orcritical-section
feature ofportable-atomic
crate must also be set by the final binary crate. When using the cfg, note that it is unsafe and enabling it for multicore systems is unsound. When using thecritical-section
feature, you need to implement the critical-section implementation that sound for your system by implementing an unsafe trait. See the documentation for theportable-atomic
crate for more information: https://docs.rs/portable-atomic/latest/portable_atomic/#optional-cfg
Features from optional dependencies
In crates that don't use the dep:
syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.