diff options
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -7,10 +7,21 @@ mod guard; mod key; mod lockable; + pub mod mutex; +pub mod rwlock; pub use guard::LockGuard; pub use key::{Key, ThreadKey}; pub use lockable::Lockable; -pub use mutex::ParkingMutex as Mutex; pub use mutex::SpinLock; + +/// A mutual exclusion primitive useful for protecting shared data, which cannot deadlock. +/// +/// By default, this uses `parking_lot` as a backend. +pub type Mutex<T> = mutex::Mutex<T, parking_lot::RawMutex>; + +/// A reader-writer lock +/// +/// By default, this uses `parking_lot` as a backend. +pub type RwLock<T> = rwlock::RwLock<T, parking_lot::RawRwLock>; |
