From 8ea16a606bfcc1ba535f6cef3cb4c162f91d2eb0 Mon Sep 17 00:00:00 2001 From: Mica White Date: Sat, 9 Mar 2024 14:48:25 -0500 Subject: RwLock --- src/lib.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/lib.rs') 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 = mutex::Mutex; + +/// A reader-writer lock +/// +/// By default, this uses `parking_lot` as a backend. +pub type RwLock = rwlock::RwLock; -- cgit v1.2.3