diff options
| author | Mica White <botahamec@outlook.com> | 2024-03-10 19:40:23 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2024-03-10 19:40:23 -0400 |
| commit | e8d25c9e6e7d5c3a5a14219fc77ea98760cef790 (patch) | |
| tree | 9436371726e0250ad38d33fa24fbf33271d4ec13 /src/lib.rs | |
| parent | 0c519b6c7801aa6a085551c8e144f0336e615870 (diff) | |
Make spin and parking lot optional
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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>; |
