summaryrefslogtreecommitdiffstats
path: root/src/mutex.rs
blob: df28ffc6e1676c26db364b362897217d85de1685 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
pub type Mutex<T> = async_std::sync::Arc<async_std::sync::Mutex<T>>;
pub type Guard<T> = async_std::sync::MutexGuardArc<T>;

pub fn new<T>(t: T) -> async_std::sync::Arc<async_std::sync::Mutex<T>> {
    async_std::sync::Arc::new(async_std::sync::Mutex::new(t))
}

pub fn clone<T>(m: &Mutex<T>) -> Mutex<T> {
    async_std::sync::Arc::clone(m)
}