1 | [package] |
2 | name = "spin" |
3 | version = "0.9.8" |
4 | authors = [ |
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 | ] |
9 | license = "MIT" |
10 | repository = "https://github.com/mvdnes/spin-rs.git" |
11 | keywords = ["spinlock" , "mutex" , "rwlock" ] |
12 | description = "Spin-based synchronization primitives" |
13 | rust-version = "1.38" |
14 | |
15 | [dependencies] |
16 | lock_api_crate = { package = "lock_api" , version = "0.4" , optional = true } |
17 | portable-atomic = { version = "1" , optional = true, default-features = false } |
18 | |
19 | [features] |
20 | default = ["lock_api" , "mutex" , "spin_mutex" , "rwlock" , "once" , "lazy" , "barrier" ] |
21 | |
22 | # Enables `Mutex`. Must be used with either `spin_mutex` or `use_ticket_mutex`. |
23 | mutex = [] |
24 | |
25 | # Enables `SpinMutex` and the default spin mutex implementation for `Mutex`. |
26 | spin_mutex = ["mutex" ] |
27 | |
28 | # Enables `TicketMutex`. |
29 | ticket_mutex = ["mutex" ] |
30 | |
31 | # Enables `FairMutex`. |
32 | fair_mutex = ["mutex" ] |
33 | |
34 | # Enables the non-default ticket mutex implementation for `Mutex`. |
35 | use_ticket_mutex = ["mutex" , "ticket_mutex" ] |
36 | |
37 | # Enables `RwLock`. |
38 | rwlock = [] |
39 | |
40 | # Enables `Once`. |
41 | once = [] |
42 | |
43 | # Enables `Lazy`. |
44 | lazy = ["once" ] |
45 | |
46 | # Enables `Barrier`. Because this feature uses `mutex`, either `spin_mutex` or `use_ticket_mutex` must be enabled. |
47 | barrier = ["mutex" ] |
48 | |
49 | # Enables `lock_api`-compatible types that use the primitives in this crate internally. |
50 | lock_api = ["lock_api_crate" ] |
51 | |
52 | # Enables std-only features such as yield-relaxing. |
53 | std = [] |
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 |
63 | portable_atomic = ["portable-atomic" ] |
64 | |
65 | [package.metadata.docs.rs] |
66 | all-features = true |
67 | rustdoc-args = ["--cfg" , "docsrs" ] |
68 | |
69 | [dev-dependencies] |
70 | criterion = "0.4" |
71 | |
72 | [[bench]] |
73 | name = "mutex" |
74 | harness = false |
75 | required-features = ["ticket_mutex" ] |
76 | |