pub mod component; pub mod unfair_se_lock; pub mod queue_mpsc; pub(crate) use component::ComponentStore; #[cfg(test)] mod tests { use std::sync::Arc; use std::sync::atomic::{AtomicU64, Ordering}; // Utility resource structure that counts the number of constructors and // destructor calls. pub struct Resource { dtor: Arc, val: u64, } impl Resource { fn new(ctor: Arc, dtor: Arc, val: u64) -> Self { ctor.fetch_add(1, Ordering::SeqCst); return Self{ dtor, val }; } } impl Drop for Resource { fn drop(&mut self) { self.dtor.fetch_add(1, Ordering::SeqCst); } } }