From e8d25c9e6e7d5c3a5a14219fc77ea98760cef790 Mon Sep 17 00:00:00 2001 From: Mica White Date: Sun, 10 Mar 2024 19:40:23 -0400 Subject: Make spin and parking lot optional --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index e99db7c..f51adb2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,6 +13,8 @@ pub mod rwlock; pub use collection::LockCollection; pub use lockable::Lockable; + +#[cfg(feature = "spin")] pub use mutex::SpinLock; /// The key for the current thread. @@ -24,9 +26,11 @@ pub type ThreadKey = key::Key<'static>; /// A mutual exclusion primitive useful for protecting shared data, which cannot deadlock. /// /// By default, this uses `parking_lot` as a backend. +#[cfg(feature = "parking_lot")] pub type Mutex = mutex::Mutex; /// A reader-writer lock /// /// By default, this uses `parking_lot` as a backend. +#[cfg(feature = "parking_lot")] pub type RwLock = rwlock::RwLock; -- cgit v1.2.3