summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 3d30330..3897615 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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>;