std_macro_extensions/mutex/macro.rs
1/// Creates a new `Mutex` instance.
2///
3/// This macro takes a value and wraps it in a `Mutex`, providing thread-safe interior mutability.
4/// The `Mutex` type ensures mutual exclusion, allowing only one thread to access the value at a time.
5#[macro_export]
6macro_rules! mutex {
7 ($val:expr) => {
8 std::sync::Mutex::new($val)
9 };
10}