one_shot_mutex/lib.rs
1//! One-shot locks that panic instead of (dead)locking on contention.
2//!
3//! These locks allow no contention and panic instead of blocking on `lock` if they are already locked.
4//! This is useful in situations where contention would be a bug,
5//! such as in single-threaded programs that would deadlock on contention.
6//!
7//! See the [`RawOneShotMutex`] and [`RawOneShotRwLock`] types for more information.
8
9#![no_std]
10
11mod mutex;
12mod rwlock;
13
14pub use mutex::{OneShotMutex, OneShotMutexGuard, RawOneShotMutex};
15pub use rwlock::{
16 OneShotRwLock, OneShotRwLockReadGuard, OneShotRwLockUpgradableReadGuard,
17 OneShotRwLockWriteGuard, RawOneShotRwLock,
18};