std_macro_extensions/rw_lock/macro.rs
1/// Creates a new `RwLock` instance.
2///
3/// This macro takes a value and wraps it in an `RwLock`, providing thread-safe access with multiple readers or a single writer.
4/// `RwLock` allows multiple immutable borrows or one mutable borrow at a time, enforcing read-write access at the runtime level.
5#[macro_export]
6macro_rules! rw_lock {
7 ($val:expr) => {
8 std::sync::RwLock::new($val)
9 };
10}