diff options
| author | Mica White <botahamec@outlook.com> | 2024-03-09 14:48:25 -0500 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2024-03-09 14:48:25 -0500 |
| commit | 8ea16a606bfcc1ba535f6cef3cb4c162f91d2eb0 (patch) | |
| tree | 0538a9de40fb0129952981df3b9c3084667bb90c /src/lib.rs | |
| parent | cc96e2ce5875e8e5c28a9ede3c30b833b0bce225 (diff) | |
RwLock
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>; |
