Skip to content

Commit

Permalink
feat(maitake-sync): add spin::RwLock (#472)
Browse files Browse the repository at this point in the history
This commit adds a synchronous `RwLock` spinlock to
`maitake_sync::spin`.

Closes #470
  • Loading branch information
hawkw committed Jan 27, 2024
1 parent c80686d commit d6199bf
Show file tree
Hide file tree
Showing 2 changed files with 428 additions and 0 deletions.
4 changes: 4 additions & 0 deletions maitake-sync/src/spin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,21 @@
//! This module provides the following APIs:
//!
//! - [`Mutex`]: a synchronous [mutual exclusion] spinlock.
//! - [`RwLock`]: a synchronous [reader-writer] spinlock.
//! - [`InitOnce`]: a cell storing a [`MaybeUninit`](core::mem::MaybeUninit)
//! value which must be manually initialized prior to use.
//! - [`Lazy`]: an [`InitOnce`] cell coupled with an initializer function. The
//! [`Lazy`] cell ensures the initializer is called to initialize the
//! value the first time it is accessed.
//!
//! [mutual exclusion lock]: https://en.wikipedia.org/wiki/Mutual_exclusion
//! [reader-writer lock]: https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock
mod mutex;
pub mod once;
mod rwlock;

pub use self::{
mutex::*,
once::{InitOnce, Lazy},
rwlock::*,
};
Loading

0 comments on commit d6199bf

Please sign in to comment.