117
117
//! - [`IndexMap`]: A hash table.
118
118
//! - [`IndexSet`]: A hash set.
119
119
//! - [`LinearMap`]: A linear map.
120
+ //! - [`mpmc::Queue`](mpmc): A lock-free multi-producer, multi-consumer queue.
121
+ //! - [`spsc::Queue`](spsc): A lock-free single-producer, single-consumer queue.
120
122
//! - [`SortedLinkedList`](sorted_linked_list::SortedLinkedList): A sorted linked list.
121
123
//! - [`String`]: A string.
122
124
//! - [`Vec`]: A vector.
123
- //! - [`mpmc::MpMcQueue`](mpmc): A lock-free multiple-producer, multiple-consumer queue.
124
- //! - [`spsc::Queue`](spsc): A lock-free single-producer, single-consumer queue.
125
125
//!
126
126
//! # Minimum Supported Rust Version (MSRV)
127
127
//!
@@ -199,12 +199,15 @@ pub mod binary_heap;
199
199
mod bytes;
200
200
#[ cfg( feature = "defmt" ) ]
201
201
mod defmt;
202
- #[ cfg( any(
203
- // assume we have all atomics available if we're using portable-atomic
204
- feature = "portable-atomic" ,
205
- // target has native atomic CAS (mpmc_large requires usize, otherwise just u8)
206
- all( feature = "mpmc_large" , target_has_atomic = "ptr" ) ,
207
- all( not( feature = "mpmc_large" ) , target_has_atomic = "8" )
202
+ #[ cfg( all(
203
+ feature = "mpmc" ,
204
+ any(
205
+ // Assume all atomics are available if we're using `portable-atomic`.
206
+ feature = "portable-atomic" ,
207
+ // Target has native atomic CAS (`mpmc_large` requires `usize`, otherwise just `u8`).
208
+ all( feature = "mpmc_large" , target_has_atomic = "ptr" ) ,
209
+ all( not( feature = "mpmc_large" ) , target_has_atomic = "8" ) ,
210
+ )
208
211
) ) ]
209
212
pub mod mpmc;
210
213
#[ cfg( any(
@@ -223,14 +226,17 @@ pub mod mpmc;
223
226
) ) ]
224
227
pub mod pool;
225
228
pub mod sorted_linked_list;
226
- #[ cfg( any(
227
- // assume we have all atomics available if we're using portable-atomic
228
- feature = "portable-atomic" ,
229
- // target has native atomic CAS. Note this is too restrictive, spsc requires load/store only, not CAS.
230
- // This should be `cfg(target_has_atomic_load_store)`, but that's not stable yet.
231
- target_has_atomic = "ptr" ,
232
- // or the current target is in a list in build.rs of targets known to have load/store but no CAS.
233
- has_atomic_load_store
229
+ #[ cfg( all(
230
+ feature = "spsc" ,
231
+ any(
232
+ // Assume all atomics are available if we're using `portable-atomic`.
233
+ feature = "portable-atomic" ,
234
+ // Target has native atomic CAS. This is too restrictive since `spsc` only requires
235
+ // load/store, but `cfg(target_has_atomic_load_store = "ptr")` is not stable yet.
236
+ target_has_atomic = "ptr" ,
237
+ // The current target is in a list in `build.rs` known to have load/store but no CAS.
238
+ has_atomic_load_store,
239
+ )
234
240
) ) ]
235
241
pub mod spsc;
236
242
0 commit comments