http_type/arc_rwlock/fn.rs
1use super::*;
2
3/// Creates a new thread-safe reference-counted read-write lock.
4///
5/// # Arguments
6///
7/// - `T` - The data type to be wrapped.
8///
9/// # Returns
10///
11/// - `Arc<RwLock<T>>` - A new atomic reference-counted read-write lock.
12#[inline(always)]
13pub fn arc_rwlock<T>(data: T) -> Arc<RwLock<T>> {
14 Arc::new(RwLock::new(data))
15}