1[package]
2name = "spin"
3version = "0.9.8"
4authors = [
5 "Mathijs van de Nes <git@mathijs.vd-nes.nl>",
6 "John Ericson <git@JohnEricson.me>",
7 "Joshua Barretto <joshua.s.barretto@gmail.com>",
8]
9license = "MIT"
10repository = "https://github.com/mvdnes/spin-rs.git"
11keywords = ["spinlock", "mutex", "rwlock"]
12description = "Spin-based synchronization primitives"
13rust-version = "1.38"
14
15[dependencies]
16lock_api_crate = { package = "lock_api", version = "0.4", optional = true }
17portable-atomic = { version = "1", optional = true, default-features = false }
18
19[features]
20default = ["lock_api", "mutex", "spin_mutex", "rwlock", "once", "lazy", "barrier"]
21
22# Enables `Mutex`. Must be used with either `spin_mutex` or `use_ticket_mutex`.
23mutex = []
24
25# Enables `SpinMutex` and the default spin mutex implementation for `Mutex`.
26spin_mutex = ["mutex"]
27
28# Enables `TicketMutex`.
29ticket_mutex = ["mutex"]
30
31# Enables `FairMutex`.
32fair_mutex = ["mutex"]
33
34# Enables the non-default ticket mutex implementation for `Mutex`.
35use_ticket_mutex = ["mutex", "ticket_mutex"]
36
37# Enables `RwLock`.
38rwlock = []
39
40# Enables `Once`.
41once = []
42
43# Enables `Lazy`.
44lazy = ["once"]
45
46# Enables `Barrier`. Because this feature uses `mutex`, either `spin_mutex` or `use_ticket_mutex` must be enabled.
47barrier = ["mutex"]
48
49# Enables `lock_api`-compatible types that use the primitives in this crate internally.
50lock_api = ["lock_api_crate"]
51
52# Enables std-only features such as yield-relaxing.
53std = []
54
55# Use the portable_atomic crate to support platforms without native atomic operations.
56# The `portable_atomic_unsafe_assume_single_core` cfg or `critical-section` feature
57# of `portable-atomic` crate must also be set by the final binary crate.
58# When using the cfg, note that it is unsafe and enabling it for multicore systems is unsound.
59# When using the `critical-section` feature, you need to implement the critical-section
60# implementation that sound for your system by implementing an unsafe trait.
61# See the documentation for the `portable-atomic` crate for more information:
62# https://docs.rs/portable-atomic/latest/portable_atomic/#optional-cfg
63portable_atomic = ["portable-atomic"]
64
65[package.metadata.docs.rs]
66all-features = true
67rustdoc-args = ["--cfg", "docsrs"]
68
69[dev-dependencies]
70criterion = "0.4"
71
72[[bench]]
73name = "mutex"
74harness = false
75required-features = ["ticket_mutex"]
76