summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2024-03-10 19:40:23 -0400
committerMica White <botahamec@outlook.com>2024-03-10 19:40:23 -0400
commite8d25c9e6e7d5c3a5a14219fc77ea98760cef790 (patch)
tree9436371726e0250ad38d33fa24fbf33271d4ec13 /src/lib.rs
parent0c519b6c7801aa6a085551c8e144f0336e615870 (diff)
Make spin and parking lot optional
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs4
1 files changed, 4 insertions, 0 deletions
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<T> = mutex::Mutex<T, parking_lot::RawMutex>;
/// A reader-writer lock
///
/// By default, this uses `parking_lot` as a backend.
+#[cfg(feature = "parking_lot")]
pub type RwLock<T> = rwlock::RwLock<T, parking_lot::RawRwLock>;